Control sun with light in viewport

Forums: Control sun with light in viewport
Houdini Integrated Plugin

Moderator: juanjgon

Control sun with light in viewport

Postby Barry Convex » Tue Nov 24, 2020 11:01 am

Barry Convex Tue Nov 24, 2020 11:01 am
Hi,

I know it's been asked in other softwares' subforums but I haven't seen anything in Houdini's and I'm stuck right now.

Would it be possible to control the sun direction simply by manipulating a classic sun or distant light in the viewport? This is how it works in Unreal for instance. It would make things a lot easier in some situations. Especially in mine right now.
I'm working on a short film where interactions between characters and sun light is really important and it's done at the animation stage in Maya so I'm provided with a locator giving the sun direction.
I know you can input a vector3 as sun direction in the render target instead of geo location but I can't figure out how it works.

Many thanks in advance!
Win7 64 - Linux Mint 16 | Gigabyte Gtx760 4gb | Intel i7 3930k | 24gb Ram
Barry Convex
Licensed Customer
Licensed Customer
 
Posts: 13
Joined: Tue Feb 23, 2010 7:29 pm

Re: Control sun with light in viewport

Postby Barry Convex » Fri Nov 27, 2020 1:36 pm

Barry Convex Fri Nov 27, 2020 1:36 pm
Hello again,

For anyone interested in some sort of solution, here is mine :

- At object level, create an environment light node. I had never used it so I don't know why I can't move the gizmo. Using qLib's instead did the work. (https://github.com/qLab/qLib)
- Unlock your render target node and replace the sundir with a float node.
- You'll notice that the environment node you just created has two parameters under the "Sky Environment Map" tab that output some data. Simply reference "Calculated Vector" into the float node inside your render target. Don't forget to set the direction to "Towards Sun" in the environment.
- If you want a preview in the viewport. Create a null. Reference "Calculate Rotate" in its rotations and then parent a houdini point light to it. Set its attenuation to none and pull it far away. You should now have opengl shadows.

Voila! A bit hacky, I'm sure there is a more efficient way to do it but I suck at maths.
Win7 64 - Linux Mint 16 | Gigabyte Gtx760 4gb | Intel i7 3930k | 24gb Ram
Barry Convex
Licensed Customer
Licensed Customer
 
Posts: 13
Joined: Tue Feb 23, 2010 7:29 pm

Return to Houdini


Who is online

Users browsing this forum: No registered users and 4 guests

Fri Mar 05, 2021 8:17 pm [ UTC ]