Jump to content
  • Advertisement
Sign in to follow this  
GamerYZ

GLSL cel-shade

This topic is 4389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to write a vertex shader for a cel-shaded game. I've been reading the lighthouse3D tutorials on this subject, but the way they are doing it is manually setting a color based on the intensity, so how should I apply the intensity if the verts already have color on them? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
The vertex shader has access to the vertex's color value through 'gl_Color' so how about multiplying the incoming color by some factor of the intensity.

Something like this maybe

if (intensity > 0.95)
factor = 1.0;
else if (intensity > 0.5)
factor = 0.5;
else if (intensity > 0.25)
factor = 0.25;
else
factor = 0.10;

result_color = gl_Color * factor;
HTH

Share this post


Link to post
Share on other sites
alright I'm getting another weird problem :(

For some reason after working and changing the vertex and fragment file couple times, the shader seems to get stuck in memory. I even deleted both files and the program is still acting as if it is running the shaders. I know I am deleting the handles to shader and program when I shut down the app....

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!