HRDI light but not reflections

Forums: HRDI light but not reflections
Houdini Integrated Plugin

Moderator: juanjgon

HRDI light but not reflections

Postby stevepickup » Sun Jul 25, 2021 9:48 am

stevepickup Sun Jul 25, 2021 9:48 am
Hello - Just thought i'd post this in case it's of use to anyone else.
I wanted to use an HDRI to light a scene but not show up in reflections... please correct me if I'm wrong but you can't do out of the box?

A quick and dirty workaround -
Drop down a Texture OSL node and paste and compile this into code box:
Code: Select all
shader raytype_contribution(
   float cam = 1 [[string label = "Camera", float min=0, float max=1]],
   float shad = 1 [[string label = "Shadow", float min=0, float max=1]],
   float AO = 1 [[string label = "Ambient occlusion", float min=0, float max=1]],
   float diff = 1 [[string label = "Diffuse", float min=0, float max=1]],
   float refl = 1 [[string label = "Reflection", float min=0, float max=1]],
   float refr = 1 [[string label = "Refraction", float min=0, float max=1]],
   output color c = 0
    )
{
    c = cam*raytype("camera") + shad*raytype("shadow") + AO*raytype("AO")
    + diff*raytype("diffuse") + refl*raytype("reflection") + refr*raytype("refraction");
}

Then wire it into the power input of the Texture image RBG you are using for your Environment HDRI
From this you can then tweak the reflection slider... and for a bonus the AO.

Not my code, was posted in another thread for a different purpose... sorry cant remember where or what.
Seems to work for this.
stevepickup
Licensed Customer
Licensed Customer
 
Posts: 29
Joined: Sun Jul 19, 2020 11:33 am

Return to Houdini


Who is online

Users browsing this forum: No registered users and 5 guests

Thu Apr 18, 2024 5:42 am [ UTC ]