Jump to content

Opengl Preview Of Custom Shader


Recommended Posts

Hi all.

All the time I crate a custom shader, using the VEX Builder or hard coding the VEX lines, it is created a default OpenGL preview for my shaders.

This is the default behaviour.

What a bout if, along with my shader I want to create a custom preview in OpenGL for this new shader, with other parameters and lighting models, or even better if I want to use an OpenGL 2 shader to previsualize my shader.

This is possible?

Thanks.

Link to comment
Share on other sites

Hi all.

All the time I crate a custom shader, using the VEX Builder or hard coding the VEX lines, it is created a default OpenGL preview for my shaders.

This is the default behaviour.

What a bout if, along with my shader I want to create a custom preview in OpenGL for this new shader, with other parameters and lighting models, or even better if I want to use an OpenGL 2 shader to previsualize my shader.

This is possible?

Thanks.

Try to set HOUDINI_OGL_ENABLE_SHADERS variable to 1. This will enable an OpenGL 2 hardware shaders in SHOP. I believe you can write your own OpenGL 2 shader and use it as preview for VEX. But I don't think that it's an easy way (and stable too) because you need to know an OpenGL SL and C.

Link to comment
Share on other sites

Try to set HOUDINI_OGL_ENABLE_SHADERS variable to 1. This will enable an OpenGL 2 hardware shaders in SHOP. I believe you can write your own OpenGL 2 shader and use it as preview for VEX. But I don't think that it's an easy way (and stable too) because you need to know an OpenGL SL and C.

I know RSL ans C so I think that to write a simple OpenGL 2 shader shouldn't be so difficult.

What compiler I have to use to generate opengl shaders in linux to use in Nvidia.

Where I have to put this shaders in order Houdini can find it, and the most important, how link the opengl shader to the SHOP?

Thanks

Link to comment
Share on other sites

I know RSL ans C so I think that to write a simple OpenGL 2 shader shouldn't be so difficult.

What compiler I have to use to generate opengl shaders in linux to use in Nvidia.

Where I have to put this shaders in order Houdini can find it, and the most important, how link the opengl shader to the SHOP?

Thanks

Try to ask edward :) I know only that ogl2 shaders are placed in $HFS/houdini/ogl2. But how to generate a dialog scripts... This is a question. I'm not sure about compiler but I think that an OpenGL2 driver doing the compilation. Maybe I'm wrong. Anyway try to dig an official ARB web site - http://www.opengl.org

You can find an OpenGL SL specifications there.

Link to comment
Share on other sites

I think you would need to add dialog scripts in the old fashion way before as it was prior to the introduction of OTLs with the SHOPsurface files, etc. I don't even remember how to do that anymore. As a hack, just make some copies of the existing OGL2 OTL definitions and edit them via Edit Contents... in the Op Type Manager. You will need to then make your OGL2 shader (with the correct extension) available in your ~/houdiniX.X/ogl2 directory. I have never tried this so your mileage may vary. :)

Just try out the default OGL2 shaders (in normal shaded mode, NOT vex mode) in SHOPs with OGL2 Gingham or something like that. Note that for most of the examples, you need correct uv's. All this was just some prototype code. You can't really do anything useful with it anyhow since there's no way to pass the which lights are enabled if you have an OGL2 vertex shader.

Link to comment
Share on other sites

Maya and Max have an OpenGL versions of "normal" shaders for preview. So I'm sure if want to write your own shader with Max API you should need to make an OpenGL equivalent. The same in Houdini. IMHO.

Btw Edward, some ogl2 shaders in Houdini have problems. I'm not sure but something with loading of input parameters.

Link to comment
Share on other sites

Which ones? To be frank, I'm not surprised as they haven't been touched in quite a while. And they're experimental anyhow.

Marble shader. I have tried to load it into 3DLabs GLSL demo but got the same result.

WARNING[ogl2_marble]: Failed to bind variable 'MarbleColor'
WARNING[ogl2_marble]: Failed to bind variable 'VeinColor'
WARNING[ogl2_marble]: Failed to bind variable 'Offset'

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...