Skip to content

Suggestion to improve shader and graphics design #80

@AntonPetrov83

Description

@AntonPetrov83

Using a lot of if ... else in the fragment shader is suboptimal plus XOR, NXOR drawing modes are not supported.
I want to try and address this. The current plan I have is:

  1. Implement shader for different drawing modes using preprocessor definitions to avoid condition checks in the fragment shader.
  2. NOR and XOR modes will be using the current canvas as a uniform texture source.
  3. Render in pure black and white colors (zeroes and ones) to simplify logic and blending math.
  4. Implement final output shader which will map black and white image from the previous step to nice color values or perform some post processing like CRT effect etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions