Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: Drago991 on 2024-05-14, 14:49:10

Title: [Solved] Corona distance different colors for each object
Post by: Drago991 on 2024-05-14, 14:49:10
Hu guyse!
I'm trying to use a material with corona distance. but I need to have two different colors for each object.
The use is for the lines and symbols on the road

Thanks!
Title: Re: Corona distance different colors for each object
Post by: romullus on 2024-05-14, 15:14:24
It would be helpful if you could show your setup and some example of what you want to achieve.
Title: Re: Corona distance different colors for each object
Post by: Drago991 on 2024-05-14, 15:20:15
oh sure!
as you can see I managed to make the lines on the asphalt but when I try to divide the colors I can only create white...
Title: Re: Corona distance different colors for each object
Post by: TomG on 2024-05-14, 15:50:34
Can you show your material set up?

Also, you might want to consider using Corona Decals for at least some of these, it will be faster and more easily controllable than Distance ;)
Title: Re: Corona distance different colors for each object
Post by: Drago991 on 2024-05-14, 16:13:31
I had thought about it but since there are so many contemporary forms it would take too long and this system seemed quicker to me
Title: Re: Corona distance different colors for each object
Post by: TomG on 2024-05-14, 19:17:11
So long as near and far are black, inside is white, top Distance is set to be distance to only those objects that should be white, bottom Distance is set to be distance to only those objects that should be yellow, I'd expect it to work. You can just work on one layer at a time to make sure it is working as intended, before adding the next layer.

Do note that distance to involves calculations and raycasting, which means there is a fair amount of processing to be done there, compared to a decal - there's even a yellow wheelchair decal in Cosmos, for instance, so that is ready made for you :)  For the solid lines, those can just be decals without any alpha bitmap so no set up needed there, which leaves only the diagonal stripes on the left to have a bitmap made for the alpha for that decal. Wouldn't be hard at all :)
Title: Re: Corona distance different colors for each object
Post by: romullus on 2024-05-14, 19:39:41
Seems to be working just fine here. As Tom said, try to disabling one mask at a time and see what are they doing.
Title: Re: Corona distance different colors for each object
Post by: Drago991 on 2024-05-15, 09:38:11
I did it. I created a material (as in the screenshot) but I leave the near-far color values ​​on black in the two Corona distances and set the desired shapes as masks and it works

Thanks guys!
Title: Re: Corona distance different colors for each object
Post by: romullus on 2024-05-15, 11:30:38
You're welcome!
Title: Re: [Solved] Corona distance different colors for each object
Post by: TomG on 2024-05-15, 13:25:11
Glad you got it working!