How to build OpenGL in custom shader?

   3983   5   0
User Avatar
Member
210 posts
Joined: Jan. 2014
Offline
This I was watching some tutorials about VOPs and the basics of building custom shaders.
Although VOPs are another quite overwhelming topic, after some trial and error I managed to build a shader from scratch that has a base color which you can enable/disable and can take in a color map which you can enable/disable.
First I thought I was doing something wrong since I wasn't able to see the texture on the model but then I just tried rendering it and there it was , the texture renders just fine.
So how do I build a shader that is capable of OpenGL?
User Avatar
Member
8583 posts
Joined: July 2007
Offline
go to Edit Rendering Parameters dialog for your material/shader

from SHOP Options add OGL tab with all properties to your shader, then connect whatever you need with your shader parms with expressions as it's the case in default materials
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
210 posts
Joined: Jan. 2014
Offline
I tried it but now I seem to realize that my OpenGL isn't working at all.
I don't get an OpenGL preview of my texture from any shader, why is that? (display textures is enabled)
User Avatar
Member
4189 posts
Joined: June 2012
Offline
Make sure to have UV. Try the attached

Also check that Display Texture is checked in Display Options/Texture

Attachments:
Screen Shot 2014-03-25 at 8.56.35 am.png (51.8 KB)
GLTest.hip (308.4 KB)
Screen Shot 2014-03-25 at 8.55.13 am.png (278.2 KB)

User Avatar
Member
210 posts
Joined: Jan. 2014
Offline
Now it works. I changed nothing just opend your scene and now it works.

Edit:
I just realized that the path was wrong. For some reason it was set to $HIP instead of $JOB.
Sorry for the trouble :roll:
Edited by - March 24, 2014 17:24:46
User Avatar
Member
4189 posts
Joined: June 2012
Offline
A good way to debug textures is to use the pictures that ship with Houdini e.g. $HFS/houdini/pic/butterfly1.pic
  • Quick Links