Sparky
Sparky copied to clipboard
Fragment shader color.
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;
Isn't this a bit outdated?
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
Why is this chinese?