Sparky icon indicating copy to clipboard operation
Sparky copied to clipboard

Fragment shader color.

Open Cyraxx13 opened this issue 10 years ago • 3 comments

Looking at it with a fresh eye I realised why it is done the way it is, so you can mark this closed. (don't code or analize code when you are tired :) )

I've heared that the if(...) is very costly in the fragment shaderand now you have this.

if (fs_in.tid > 0.0) { int tid = int(fs_in.tid - 0.5); texColor = texture(textures[tid], fs_in.uv); } color = texColor * intensity;

You should have a static white color as an unsigned int as the default color attribute and if the Sprite is not textured you would change it in the submit method, else it is not needed because you would basically multiply the textured color with 1.

So you could have s'thing like this in the shader instead of the if(...)

color = fs_in.color * texColor * intensity;

Cyraxx13 avatar Apr 08 '15 21:04 Cyraxx13

Isn't this a bit outdated?

ViktorPopp avatar Aug 11 '24 16:08 ViktorPopp

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

pengyz avatar Aug 11 '24 16:08 pengyz

Why is this chinese?

ViktorPopp avatar Aug 11 '24 17:08 ViktorPopp