I have imported some geo via FBX which has multiple UV sets. These sets are imported correctly and show up as vertex params uv and uv2. When I use uv in a glsl context via gl_TexCoord all works well, but when I try and use the second set uv2 in via gl_TexCoord I get nuttin!! How would I access this second set of coords in the shader?
I am used to cgfx / hlsl and would just bind a variable to an app interpollant via a semantic but not sure how it all works in the glsl houdini context….
Found 4 posts.
Search results Show results as topic list.
Technical Discussion » Multiple UV sets in GLSL
- jmmistrot
- 4 posts
- Offline
Technical Discussion » Simple Texture GLSL shader
- jmmistrot
- 4 posts
- Offline
ahhh the polygon was the key! I like using manual updates as I typically have some big networks and Houdini likes to crash.. awesome great thanks
Technical Discussion » Simple Texture GLSL shader
- jmmistrot
- 4 posts
- Offline
So maybe I am having a graphics card issue then? I hooked up the OGL2 Decal shader and assigned it to a material suboutput and the material to a sphere with a UVTexture SOP on it. Then I chose a map for the textureidx param of the GLSL shader and ouila black is all I get! A beautiful black sphere..
I have an 8800 GTX. Would someone mind sending me a known working hip file with this setup… I have attached mine:
I have an 8800 GTX. Would someone mind sending me a known working hip file with this setup… I have attached mine:
Technical Discussion » Simple Texture GLSL shader
- jmmistrot
- 4 posts
- Offline
This is my first foray into GLSL in Houdini and shading in general in Houdini.
I have a really simple example I am trying to get working to no avail.
I am trying to figure out how to hook up a texture with a sampler in a GLSL SHOP… I created a new type operator of type SHOP: GLSL and then entered my GLSL code Here is what I have:
Vertex Shader Code:
varying vec3 position;
varying vec2 diffuse_uv;
void main(void)
{
position = vec3(gl_ModelViewMatrix * gl_Vertex);
gl_Position = ftransform();
diffuse_uv = vec2(gl_MultiTexCoord0);
}
Fragment shader code:
varying vec3 position;
varying vec2 diffuse_uv;
uniform sampler2D diffuse_sampler;
void main(void)
{
gl_FragColor = texture2D(diffuse_sampler,diffuse_uv ) ;
gl_FragColor.a = 1.0;
}
Can anyone point me to an example of how to hook this up? I am not sure what is next.. I added a parameter to the type: OGL Texture layer… and got the sampler hooked up but the UVs are screwed-up… I added a TextureUV SOP to my geo but the Uvs are not getting through to the material…I am not sure what is the semantical sugar to hook all this up..?
-jm
I have a really simple example I am trying to get working to no avail.
I am trying to figure out how to hook up a texture with a sampler in a GLSL SHOP… I created a new type operator of type SHOP: GLSL and then entered my GLSL code Here is what I have:
Vertex Shader Code:
varying vec3 position;
varying vec2 diffuse_uv;
void main(void)
{
position = vec3(gl_ModelViewMatrix * gl_Vertex);
gl_Position = ftransform();
diffuse_uv = vec2(gl_MultiTexCoord0);
}
Fragment shader code:
varying vec3 position;
varying vec2 diffuse_uv;
uniform sampler2D diffuse_sampler;
void main(void)
{
gl_FragColor = texture2D(diffuse_sampler,diffuse_uv ) ;
gl_FragColor.a = 1.0;
}
Can anyone point me to an example of how to hook this up? I am not sure what is next.. I added a parameter to the type: OGL Texture layer… and got the sampler hooked up but the UVs are screwed-up… I added a TextureUV SOP to my geo but the Uvs are not getting through to the material…I am not sure what is the semantical sugar to hook all this up..?
-jm
-
- Quick Links