How is "Primitive Type: Primitive" rendered and customized?

   944   3   1
User Avatar
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
User Avatar
Member
8 posts
Joined: 7月 2022
Offline
See the attachment for the difference in shading.
Edited by rodenluo - 2022年8月17日 10:52:08

Attachments:
Snipaste_2022-08-17_17-50-02.png (1.2 MB)
Snipaste_2022-08-17_17-49-02.png (877.7 KB)

User Avatar
スタッフ
5161 posts
Joined: 7月 2005
Offline
If you assign the material at the Object level, it should work. Not sure why it isn't picking up the detail-level assignment, but it should -looks like a bug.
User Avatar
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!

Attachments:
matnet inside geo not working.png (2.7 MB)
matnet inside obj working.png (2.7 MB)

  • Quick Links