How is "Primitive Type: Primitive" rendered and customized?
944 3 1- rodenluo
- Member
- 8 posts
- Joined: 7月 2022
- Offline
Hi,
If I have a sphere with "Primitive Type: Polygon", then I can attach a shader to it and change the color. Or even, I can create a custom shader with custom vertex and fragment shaders. All the changes can be revealed in the viewport rendering.
However, if I have a sphere with "Primitive Type: Primitive", then, I cannot even apply a custom material. I guess that's because there are no faces as primitive and the material only works with faces (or probably also lines, I'm new to Houdini, not quite sure here). But in the viewport, there is indeed a sphere with a white base color shaded. I found I can attach a color node and change the shading color. My question is how can I create custom vertex and fragment shaders to control the shading of "Primitive Type: Primitive" in the viewport?
PS: I want to achieve sphere impostor and cylinder impostor rendering in the viewport.
Related post in Houdini forum: https://www.sidefx.com/forum/topic/84903/ [www.sidefx.com]
Sphere impostor: https://paroj.github.io/gltut/Illumination/Tutorial%2013.html [paroj.github.io]
Cylinder impostor: https://stackoverflow.com/questions/9595300/cylinder-impostor-in-glsl [stackoverflow.com]
Thanks,
Roden
If I have a sphere with "Primitive Type: Polygon", then I can attach a shader to it and change the color. Or even, I can create a custom shader with custom vertex and fragment shaders. All the changes can be revealed in the viewport rendering.
However, if I have a sphere with "Primitive Type: Primitive", then, I cannot even apply a custom material. I guess that's because there are no faces as primitive and the material only works with faces (or probably also lines, I'm new to Houdini, not quite sure here). But in the viewport, there is indeed a sphere with a white base color shaded. I found I can attach a color node and change the shading color. My question is how can I create custom vertex and fragment shaders to control the shading of "Primitive Type: Primitive" in the viewport?
PS: I want to achieve sphere impostor and cylinder impostor rendering in the viewport.
Related post in Houdini forum: https://www.sidefx.com/forum/topic/84903/ [www.sidefx.com]
Sphere impostor: https://paroj.github.io/gltut/Illumination/Tutorial%2013.html [paroj.github.io]
Cylinder impostor: https://stackoverflow.com/questions/9595300/cylinder-impostor-in-glsl [stackoverflow.com]
Thanks,
Roden
- rodenluo
- Member
- 8 posts
- Joined: 7月 2022
- Offline
- malexander
- スタッフ
- 5161 posts
- Joined: 7月 2005
- Offline
- rodenluo
- Member
- 8 posts
- Joined: 7月 2022
- Offline
Thanks, malexander! I initially put the material network inside the geo, and put my custom glsl node inside the material network, and then applied the material after the sphere (Primitive type: Primitive). The custom glsl is not taking effect.
But after I moved the material network one level up inside the obj, it works!
I will see if I can leverage this custom glsl to render impostors. Thanks!
But after I moved the material network one level up inside the obj, it works!
I will see if I can leverage this custom glsl to render impostors. Thanks!
-
- Quick Links