Jump to content

GLSL shader for high quality lighting (glH_MaterialPass=1)?


Recommended Posts

I'm trying to write my own stylized shaders in Houdini. I've checked https://www.sidefx.com/docs/houdini/shade/opengl.html and https://www.sidefx.com/docs/houdini/shade/glsl.html .

I've also found the code of a default shader in $HFS/houdini/glsl/asset/ogl3_default_glsl_shader.prog, which uses ogl3_default_glsl_shader.frag:
 

if(glH_MaterialPass == 0)
	{
            // Direct lighting pass, compute illumination
	    lamb  = vec3(0.0);
	    ldiff = vec3(0.0);
	    if(has_env_map)
		lspec = vec3(0.0);
	    else
		lspec += vec3(reflect) * mspec * (1-alpha) * 0.5;
	    HOUlightingModel(p, nN, ambient_color,diff,specular_color,
			     metallic_color, lamb, ldiff, lspec,
			     rough, diff_rough, ior, mtl, specular_model,alpha);

#using envLighting
	}
	else
	    lspec = mspec;
    



What does #using envLighting do...? Is #using even a GLSL keyword?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...