Robert Shelline

Robert Shelline

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Accessing lights for a GLSL viewport shader May 3, 2016, 12:16 p.m.

Thank you, twod. I think I also realized that part of the problem was that I was trying to access the lights in the fragment shader, when I should be accessing them in the vertex shader. I'll experiment and report back what I find.

Accessing lights for a GLSL viewport shader May 2, 2016, 3:45 p.m.

I'm attempting to write a custom GLSL shader for the viewport to aid in the development of a game that will have a toon shaded style (following some ideas from this Guilty Gear Xrd talk [youtube.com] from GDC). I want to end up with the same shader applied in the viewport as the shader that will be used in the game to make the modeling and texturing pipeline easier.

I'm new to GLSL and learning by experimenting as I go. I've been able to hardcode a simple directional light in the fragment shader that is relative to the viewport by using a vec3:

if (dot(nN, lightDirection) < 0) {
lspec = vec3(1.0);
} else {
lspec = vec3(0.0);
}
(I'm using lspec to test the formula at this point, because it's on the top layer.)

The next step is to pull the lightDirection from a Houdini light instead of hard coding it. This is where I'm running into some problems.



There are two sources of documentation I've found:

http://www.sidefx.com/docs/houdini15.0/shade/opengl [sidefx.com]

http://www.sidefx.com/docs/hdk15.0/_h_d_k__viewport_g_l3.html [sidefx.com]

The first says to use light uniform blocks like this:

layout(std140) uniform light0
{
vec3 pos;
vec3 dir;
vec3 atten;
vec3 amb;
vec3 spec;
vec3 diff;
float coscutoff;
bool point;
} lightSource0;
When I use this, and try to get lightSource0.pos, the model goes black and has no lighting applied. I'd like to query this variable to debug it, but I'm not sure how to do that within GLSL itself.

The second source of documentation uses a slightly different variable:

layout(std140) uniform glH_Light0
{
vec3 pos; // light position, world space
vec3 dir; // light direction, world space
vec3 atten; // attenuation - .x: d^2, .y: d, .z: const
vec3 amb; // ambient color component
vec3 spec; // specular component
vec3 diff; // diffuse component
float coscutoff; // cosine(cutoff) to compare to dot(dir,P-pos)
bool point; // point light (true), spot light (false)
} lightSource0;
When I use this code, the shader fails to compile and says “ERROR: Multiple definitions of interface block ‘glH_Light0’ differ in name/type/order/qualification of members”. Because of this error, I think that the glH_Light0 name is the correct one to use, but I'm not implementing this correctly. I've looked for more documentation on this, but have come up dry. Does anyone know how to properly reference lights in GLSL? I appreciate any help or insights.

Need help troubleshooting Amazon Cloud Rendering July 3, 2015, 2 p.m.

Alright, I found the logs on Amazon EC2, and everything seems to be running fine on their end. There's just a problem when I go to render from Houdini, where the files for some reason are not able to make it to the server.

When I first start up a machine on the cloud, it doesn't cause the error message on the HQueue node in Houdini, but every subsequent attempt to render while the EC2 machine is running causes an error in Houdini that says “Failed to save output to file”. I tried making a new test file where I just dropped in some basic geometry and materials, but it gives me the same errors.