Jump to content

Tomster

Members
  • Posts

    4
  • Joined

  • Last visited

Tomster's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. on another note: how come u can only apply post-processing shaders before a DrawImage command? Is there any way of running a Vert and Frag shader when or while rendering to the normal buffer? How would someone write his/her own rendering code with leadwerks?
  2. nice idea, but as far as i know and searched the net there is no way of getting normals information from within a fragshader, since the gl_normal command is meant to be used in vertex-shaders only. so that won't work. (I did try it out by the way ) Is there any other way of implementing toon shading? I mean not as a post-processing effect? I tried adding my shaders to the modell .mat file, but the engine crashes on load and doesn't throw any specific error messages in the log file. the last line in there is the fragment-shader loading and then: crash!
  3. by not kicking in i mean not working. at least not the way it should. It won't calculate the normals of the vertexes so the objects can be rendered correctly. all i get right now is a screen with a redish color, the one the frag shader is producing, bot no signs of geometry in the scene. just a solid redish overlay, depending on what i pass to the shader as the lightDir variable
  4. Hi everyone, I am currently trying to add a toonshading effect to my project. The Frag shader is working but the vertexshader is not kicking in. I created the shader usung TShader Toonshader = LoadShader("abstract::Toon.vert", "abstract::Toon.frag"); and calling SetShader(Toonshader); before DrawImage(...); This is the vert code uniform vec3 lightDir; varying float intensity; void main() { vec3 ld; intensity = dot(lightDir,gl_Normal); gl_Position = ftransform(); } and this is the frag code varying float intensity; void main() { vec4 color; if (intensity > 0.95) color = vec4(1.0,0.5,0.5,1.0); else if (intensity > 0.5) color = vec4(0.6,0.3,0.3,1.0); else if (intensity > 0.25) color = vec4(0.4,0.2,0.2,1.0); else color = vec4(0.2,0.1,0.1,1.0); gl_FragColor = color; } any help would be appreciated.
×
×
  • Create New...