Custom GLSL shader

   1536   3   2
User Avatar
Member
41 posts
Joined: 6月 2009
Offline
This aspect is not good explain in documentation.

May be i something not understand correctly but i have several question:

1. Can i create my own custom GL-tag, for use in Frag/Vertex context ? Or may be any other way for use custom user data from Houdini parameter's in GL shader context ?
2. How i can get correct name GL-tag in OpenGL context ?

For example:
If i use buil-in tag “ogl-emit” in OpenGL context variable name is: emission_color.
But i want use buit-in tag “ogl-emit_intensity” ? What is correct name this variable in OpenGL context ? Where i can find this info ?
Edited by Dronson - 2020年9月21日 06:49:47
User Avatar
Member
159 posts
Joined: 2月 2018
Offline
Sadly, Houdini's OpenGL is as poor as the COP module.
Edited by EricSheng - 2020年9月21日 08:15:55
User Avatar
スタッフ
5160 posts
Joined: 7月 2005
Offline
It seems like some of the documentation for custom GLSL shaders may have been lost when GL tags were introduced. The tags are for binding parameters to our viewport shader. For a custom shader, you only need to name the OP parameter the same as your GLSL uniform, with the same structure (eg, vec3 = Color or Float Vector 3, float = float, sampler2D = File-Image). So you really don't need tags for custom shaders.

Geometry inputs are also named the same as their Houdini attributes (P, N, uv, Cd, etc. “in vec3 P”). It becomes a little tricky if you're accessing Vertex or Primitive attributes as they aren't supported by GL, so they are emulated with a geometry shader and a TBO. You can see how this works in the ogl3_default_glsl_shader.vert/geom files in $HFS/houdini/glsl/asset.
User Avatar
Member
41 posts
Joined: 6月 2009
Offline
twod - thankyou very much! Its so simple )) and all works fine!
Thankyou!
Edited by Dronson - 2020年9月21日 10:10:25
  • Quick Links