Author Topic: Corona Distance material render/include hidden objects.  (Read 845 times)

2023-03-27, 08:05:50

JoachimArt

  • Active Users
  • **
  • Posts: 217
    • View Profile
    • JoachimArt
It would be nice if Distance material doesn't not include hidden objects when rendering.
« Last Edit: 2023-03-27, 08:19:48 by JoachimArt »

2023-03-27, 10:40:39
Reply #1

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8779
  • Let's move this topic, shall we?
    • View Profile
    • My Models
I don't agree with that. If you want some object not to affect distance, you simply remove it from the list. I find it very helpful when i can use objects that are influencing distance shader and are hidden from view at the same time. It would be fine if we could choose which behaviour we want to use, but definitely not ok if proposed option would be the only one.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-03-27, 10:48:09
Reply #2

JoachimArt

  • Active Users
  • **
  • Posts: 217
    • View Profile
    • JoachimArt
I don't agree with that. If you want some object not to affect distance, you simply remove it from the list. I find it very helpful when i can use objects that are influencing distance shader and are hidden from view at the same time. It would be fine if we could choose which behaviour we want to use, but definitely not ok if proposed option would be the only one.

It can be hidden froom view nonetheless, or nearly by displaying it as a box - so I disagree.
But here's an instance where the current solution is nearly unusable. Right now I animate objects to turn lights on/off. and I want to turn some meshes off during the timeline. In it's current form that is impossible and I have to then stop the rendering of the animation and manually remove the object from the list, start the rendering from that frame, and keep doing this over the course of the animation. Which makes it impossible to set up an animation using the distance map to control the lights. Basically, if you had this option it would increase the use case of the shader a lot.

2023-03-27, 12:47:59
Reply #3

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
The first post is a double negative ("doesn't not") so I am not entirely sure what you were requesting. You would like hidden objects to NOT affect a Distance Map? Or you would like them TO affect a Distance Map?

I am also not clear of the example you give about animated objects to turn lights on and off, can you explain, or show in a video would probably be best.

Right now, if an object is hidden, it continues to affect the distance map, which is the most useful set up as then you can have invisible controllers in the scene, e.g. you can slide a box closer to a light to make the light grow brighter or dimmer (and naturally you don't want the box to be seen in the render, it's just a controller), or use a simplified shape to drive any Distance Map effect with that parented to an (animated) more complex shape. Right now, I don't understand how a visible object would make a good controller for light intensity, or why that object would need to change it's hidden/unhidden status? If you need the object visible in the viewport (to control it), but invisible in the render, this can be done by unchecking the "Renderable" property of the object rather than hiding it.
Tom Grimes | chaos-corona.com
Product Manager | contact us

2023-03-27, 12:55:21
Reply #4

JoachimArt

  • Active Users
  • **
  • Posts: 217
    • View Profile
    • JoachimArt
The first post is a double negative ("doesn't not") so I am not entirely sure what you were requesting. You would like hidden objects to NOT affect a Distance Map? Or you would like them TO affect a Distance Map?

I am also not clear of the example you give about animated objects to turn lights on and off, can you explain, or show in a video would probably be best.

Right now, if an object is hidden, it continues to affect the distance map, which is the most useful set up as then you can have invisible controllers in the scene, e.g. you can slide a box closer to a light to make the light grow brighter or dimmer (and naturally you don't want the box to be seen in the render, it's just a controller), or use a simplified shape to drive any Distance Map effect with that parented to an (animated) more complex shape. Right now, I don't understand how a visible object would make a good controller for light intensity, or why that object would need to change it's hidden/unhidden status? If you need the object visible in the viewport (to control it), but invisible in the render, this can be done by unchecking the "Renderable" property of the object rather than hiding it.

Hmm, sorry for the bad explanation.
For what you explain with multiple controllers you can easily do this without a messy scene when they are visible. Just making all objects to be displayed as boxes and not renderable. They don't need to be hidden to not be renderered.
But in my scene, I have a wheel of fortune model with many lights around it, and I want to animate the lights in different ways, using boxes that are animated as distance map....I can't hide the lights as you suggest they are lightbulb models and they need to be visible, just showing different strengths of light. But the wheel lights has different behaviors, like circling lights, pulsating light etc. which I use different boxes for. But I then want to render animations with all these behaviors without having to set up multiple scenes, so it can be rendered in one sequence. In order to do that I wanted to hide the objects that are not being active at the current moment. But since the distance map renders all the hidden objects it's not possible.  Best options would be to have a tick box in the material to give you the option to include hidden objects or not in my opinion, since you often build up complex scenes in max and turn layers on and off for different renders. I guess you guys don't see the problem, so I'll just find workrounds...
« Last Edit: 2023-03-27, 13:01:47 by JoachimArt »

2023-03-27, 13:07:41
Reply #5

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
That makes it clearer, ty! So if I understand, you have groups of objects driving an animation, and want them all in the include list for the distance map and then have them affect or not affect the distance map via animating some other feature of the groups (where you have chosen hiding the groups as that other effect).

You COULD put it under a feature request to have some checkbox (it's not a bug, though), not sure that it would get accepted but you can ask.

As a note there are definitely other things you can do. So if I want Group A of objects to affect the animation from 0 to 89, then Group B that gives a different result from 90 to 179, I'd just animate the positions of Group A and Group B. For the first 90 frames, Group A is "in position" to affect the animation, and Group B is "way far away to not affect the scene", then between 89 and 90 I would just keyframe group A from being "in position" at 89 to "way far away" at 90, and group B doing the opposite, KF'ed to "way far away" and 89 and then "in position" at 90. There are probably other ways to do this too, though :)
Tom Grimes | chaos-corona.com
Product Manager | contact us

2023-03-27, 13:16:00
Reply #6

Ink Visual

  • Active Users
  • **
  • Posts: 158
    • View Profile
Your case is very specific, I think majority of situations the current behaviour is as most users would expect it to work.
Rather than hiding/unhiding objects, can you plug in Corona Select map into the light intensity slot? With Corona select you ill be choosing between Corona Distance map (when distance map is to control the intensity) and some white/black solid colour map when you want your light to be simply disabled/enabled. You can easily animate Corona Select Slots (which one is active in what timeframes)

2023-03-27, 13:47:24
Reply #7

JoachimArt

  • Active Users
  • **
  • Posts: 217
    • View Profile
    • JoachimArt
That makes it clearer, ty! So if I understand, you have groups of objects driving an animation, and want them all in the include list for the distance map and then have them affect or not affect the distance map via animating some other feature of the groups (where you have chosen hiding the groups as that other effect).

You COULD put it under a feature request to have some checkbox (it's not a bug, though), not sure that it would get accepted but you can ask.

As a note there are definitely other things you can do. So if I want Group A of objects to affect the animation from 0 to 89, then Group B that gives a different result from 90 to 179, I'd just animate the positions of Group A and Group B. For the first 90 frames, Group A is "in position" to affect the animation, and Group B is "way far away to not affect the scene", then between 89 and 90 I would just keyframe group A from being "in position" at 89 to "way far away" at 90, and group B doing the opposite, KF'ed to "way far away" and 89 and then "in position" at 90. There are probably other ways to do this too, though :)

Yes, you understood correctly now :) The reason why I thought it was a bug is that i'm just used to 3ds max treating all hidden objects as not active and everything else you do through the object properties of the object, like renderable, visible to camera etc etc - which is why I never hidden distance map objects before, just turned them into wireboxes....But I guess it makes sense in most cases for it to be as it currently is - just not in this case :D
ANyway, I split it up so that each box animation has its own timeline and are keyframes to a different location while not being active. So it works ok, just had to make a workaround.

2023-03-30, 14:03:05
Reply #8

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12708
  • Marcin
    • View Profile
I agree that an option for the Corona Distance map to ignore hidden objects makes sense.

At the same time I think the current setup you are using is not optimal, it's probably too complicated. If you could show some renders or describe better what you are doing, perhaps others could come up with some other solutions.

If you are controlling the appearance of something (e.g. lights) using some geometry (e.g. boxes) and a CDistance map, then why instead of hiding objects you cannot just move them away? On one frame of animation move the object super far away so that it stops influencing anything. How is this different than hiding it?
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2023-03-30, 14:06:28
Reply #9

JoachimArt

  • Active Users
  • **
  • Posts: 217
    • View Profile
    • JoachimArt
Hi, yeah moving them away works, it's what I did. The reason it is different is that Im using a render manager and render the scene multiple times with different objects visible, and therefor it would have been easier to just set up everything in one timeline. That's why I had to make the different render passes happening on different areas of the timeline, because I could not hide the distance maps, only move them away.
« Last Edit: 2023-03-30, 14:17:01 by JoachimArt »