Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: aaouviz on 2024-04-11, 10:07:47

Title: Node to rotate a texture?
Post by: aaouviz on 2024-04-11, 10:07:47
I'm wondering if anyone has a tip for me.

I often work with HDRI direct visibility override, but the HDRI image/file is the same as the environment texture, just rotated somewhat. See the attached image below.

The problem is that I need to have a duplicate of the HDRI. If I change the hdri or edit its settings I have to do it twice. Once for the environment and again for the direct override.

Is there some sort of node I can plug in a texture into as an intermediate so it takes the texture and rotates it more? Does this make sense?

Again, see the attached image for how I expect it could work.

Thanks for any help!
Title: Re: Node to rotate a texture?
Post by: romullus on 2024-04-11, 11:28:13
Corona mapping randomizer should do the trick for you.
Title: Re: Node to rotate a texture?
Post by: aaouviz on 2024-04-11, 12:06:07
Dammmmm, so simple I never thought of it!

Thanks Romullus, that will indeed do the trick
Title: Re: Node to rotate a texture?
Post by: romullus on 2024-04-11, 12:17:24
You're welcome!
Title: Re: [solved] Node to rotate a texture?
Post by: aaouviz on 2024-04-11, 12:20:48
Actually, I jumped the gun there!...

Testing this... it doesn't work?

What should my settings in the randomizer be? Say; I want to rotate the direct one by 90 degrees (so the sun moves left or right) what should I do? Nothing seems to work.
Title: Re: [solved] Node to rotate a texture?
Post by: romullus on 2024-04-11, 14:34:56
Indeed it doesn't. Strange, but i think i remember that this used to work, maybe something got broken at some point? I also found that W rotation in Corona bitmap rotates in wrong axis when in spherical mode. Something seems not right here. Anyway, sorry for misleading, it seems you'll need to find other solution.
Title: Re: Node to rotate a texture?
Post by: Tom on 2024-04-12, 02:33:59
You could try the following setup: plug the Default Output to the Environment slot, and apply a self illuminated CoronaMtl to a geosphere that will act as a "geometry direct override" if that makes sense.

If you rotate the HDRi, the rotation is reflected on the geosphere as well. But if you want the geosphere to have a different orientation than your HDRi all you have to do is to rotate it in the Top viewport.
You will have to find the correct orientation of the geosphere first so that its mapping matches the one of the environment slot, and play with the self-illumination intensity as well but this setup works.

I hope it helps.
Title: Re: Node to rotate a texture?
Post by: romullus on 2024-04-12, 09:44:27
Another possible option would be to use controller nodes for parameter linking.
Title: Re: Node to rotate a texture?
Post by: Tom on 2024-04-12, 09:53:31
Yes, I was thinking of that possibility too, but didn't find how to do that.
Could you explain a bit further?
Title: Re: Node to rotate a texture?
Post by: romullus on 2024-04-12, 11:15:17
Sure, it's very simple operation. You don't have to wire every single control, just those that you want to be instanced.
Title: Re: Node to rotate a texture?
Post by: Tom on 2024-04-12, 11:29:55
Thanks.
But this is not what he wants: he doesn't want to instance the rotation value, he wants a control to change the rotation of only one map, and the two maps being instanced.
Title: Re: Node to rotate a texture?
Post by: romullus on 2024-04-12, 11:58:53
Then you don't wire rotation and wire everything else. I think the only option that can't be instanced is loading of bitmap itself, so if you'd want to change HDRI, you have to do it on both nodes.
Title: Re: Node to rotate a texture?
Post by: pokoy on 2024-04-12, 12:18:11
Surprisingly difficult problem :D
I thought BerconMapping Map could help but it doesn't work on environment maps, only 2D/Object/Screen.
UVW Randomizer does funny things, too.
Title: Re: [solved] Node to rotate a texture?
Post by: aaouviz on 2024-04-12, 16:01:42
Indeed it doesn't. Strange, but i think i remember that this used to work, maybe something got broken at some point? I also found that W rotation in Corona bitmap rotates in wrong axis when in spherical mode. Something seems not right here. Anyway, sorry for misleading, it seems you'll need to find other solution.

Hey Dev's, any idea why this is happening? It should work, right?

My guess is because there is no checkbox for 'env' randomization then it doesn't know to apply the randomness to the env slot?
Title: Re: Node to rotate a texture?
Post by: jrgby on 2024-04-12, 16:16:03
OSL might do what you're after, maybe?
Title: Re: Node to rotate a texture?
Post by: Aram Avetisyan on 2024-04-13, 05:58:14
Ideally, you would use the OSL UVW Transform map and it should be enough, but it simply multiples the input values, does not transform.

While this:
OSL might do what you're after, maybe?

works exactly as you would expect. So give it a go.

P.S. it actually works for CoronaBitmap too (instead of OSL file name map), it is just 3ds Max that does not show the node connection lines, but it is there.