Author Topic: [Solved] Corona distance different colors for each object  (Read 329 times)

2024-05-14, 14:49:10

Drago991

  • Active Users
  • **
  • Posts: 12
    • View Profile
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!
« Last Edit: 2024-05-15, 11:31:02 by romullus »

2024-05-14, 15:14:24
Reply #1

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8893
  • Let's move this topic, shall we?
    • View Profile
    • My Models
It would be helpful if you could show your setup and some example of what you want to achieve.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2024-05-14, 15:20:15
Reply #2

Drago991

  • Active Users
  • **
  • Posts: 12
    • View Profile
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...

2024-05-14, 15:50:34
Reply #3

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5546
    • View Profile
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 ;)
Tom Grimes | chaos-corona.com
Product Manager | contact us

2024-05-14, 16:13:31
Reply #4

Drago991

  • Active Users
  • **
  • Posts: 12
    • View Profile
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

2024-05-14, 19:17:11
Reply #5

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5546
    • View Profile
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 :)
Tom Grimes | chaos-corona.com
Product Manager | contact us

2024-05-14, 19:39:41
Reply #6

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8893
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Seems to be working just fine here. As Tom said, try to disabling one mask at a time and see what are they doing.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2024-05-15, 09:38:11
Reply #7

Drago991

  • Active Users
  • **
  • Posts: 12
    • View Profile
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!

2024-05-15, 11:30:38
Reply #8

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8893
  • Let's move this topic, shall we?
    • View Profile
    • My Models
You're welcome!
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2024-05-15, 13:25:11
Reply #9

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5546
    • View Profile
Glad you got it working!
Tom Grimes | chaos-corona.com
Product Manager | contact us