Page 1 of 1

Projection Puzzle

PostPosted: Wed May 24, 2023 9:32 am
by Andreas_Resch
I have a little puzzle for the trigonometry specialists here. In the node setup below you can see a little spotlight that I've scaled and rotated into a place where I like it. I would like to see that as the "neutral" setup. What I want to do now, is to stack a transformation on top of that so that I can rotate that setup in world coordinates. Let's say I want to light to come from the opposite side of the sphere, I would like to rotate the setup by 180° on the Z axis to achieve that. But now I would have to touch several value to get the light there.
In the unlinked node below you can see how I would rotate the light by 90°. That's basically what I want to do - but to the already transformed light. In Blender I can do that by sequencing vector transformations. But in Octane there doesn't seem to be a way to sequence projections.

I hope I have explained it well enough. Any help is appreciated.

Projection_01.jpg

Re: Projection Puzzle

PostPosted: Wed May 24, 2023 1:56 pm
by jobigoud
Chaining projections should be doable by making an OSL projection that takes another projection as input.
I think it would be placed in between, so your current spherical projection would plug into it, and this new programmatic projection would use the position resulting from your spherical projection as its input (instead of the global P). It would then take its own transform and apply it to the input point and return the result.

Re: Projection Puzzle

PostPosted: Wed May 24, 2023 2:19 pm
by Andreas_Resch
Yeah. I also thought that this might work. But unfortunately my OSL programming skills are zero. If there's a way to solve this with the internal nodes it would be preferable. You always have to keep those OSL shaders with your project files which is extra maintenance. But if anybody has the time to create such an OSL shader, it would be great. Cheers.

A good workround - at least for my setup that I use a lot - was to bake all my HDRs into new zeroed-out HDRs. I can combine them now and just "add" the rotation to them equally. It's worth the time if you use the setup a lot. But for the occasional set, a stacked version might be preferable.

Re: Projection Puzzle

PostPosted: Wed May 24, 2023 3:26 pm
by jobigoud
There is also the texture node called "UVW transform" (Octane texture > Mapping > UVW transform). It takes a texture and a transform, see if that could help. In this case it would go after your RGB image.

Re: Projection Puzzle

PostPosted: Wed May 24, 2023 3:37 pm
by Andreas_Resch
jobigoud wrote:There is also the texture node called "UVW transform" (Octane texture > Mapping > UVW transform). It takes a texture and a transform, see if that could help. In this case it would go after your RGB image.


Thanks. I've tried that. But that works in object space and I would need the transformations to work in world space. And with the projection located before all that in the chain, all the axis are off. I guess an intermediate OSL projection will be the way to go.