Author Topic: Texture based on light occlusion?  (Read 1646 times)

2022-08-26, 11:13:08

aaouviz

  • Active Users
  • **
  • Posts: 941
    • View Profile
    • Another Angle 3D
Hi all,

I thought this would be simple enough, but it's turning out to be trickier than expected.

I thought I'd have a go at replicating this BlenderGuru tutorial in 3DSMAX. https://www.youtube.com/watch?v=0YZzHn0iz8U&t=1016s&ab_channel=BlenderGuru

I'm stumbling on how to show the lights only on the dark side of the earth. AKA; How can I make a texture appear only when no light is bouncing on it?

Of course I'm using a Corona sun and no environment, and I thought that light/dark fall-off node would work, but it doesn't.

I've had some success with TextureObjectMask (putting a plane in the middle of the Earth/Sphere and locking it's 'lookat' constraint to the sun. This method works... but it's kinda heavy and buggy.) I've never used this texture node before.

Side-note bug report: It seems if I plug this TextureObjectMask into a CoronaPhysicalMtl and I want to replace it later with a different texture I can't - I just get a little red dot disallowing me to plug it in.. what's going on here?)

Anyway, any other tips for me to do this dark/light occlusion?

Many thanks!
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2022-08-26, 11:38:31
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 13130
  • Marcin
    • View Profile
What you are trying to do would be a fake. There are lights on Earth which are turned on during daytime, you just don't see them because the sunlight is stronger. If you set up strong sunlight and cast it on some area where there are weaker lights, you will not see those lights. The same weak lights will be however visible in the shadows.

I am afraid the fake approach with "something is masked based on illumination" is not possible with Corona at the moment. We have a feature request for supporting the shadow/light options in Falloff, but I don't think it's high priority.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-08-26, 12:01:52
Reply #2

pokoy

  • Active Users
  • **
  • Posts: 1922
    • View Profile
While the Falloff map in Shadow/Light mode is not supported you can still use its Towards/Away mode and use whatever object you want for the black to white transition.

Attached is a scene (max 2018 and 2021, CR7) that has a sphere and a CoronaSun object. The sphere's material uses a Falloff map in its Self Illumination channel, which is then nested in a Corona CC map to drive the value and gradient (use Brightness, Gamma and Exposure in order to control it). The effect is based on the CoronaSun object's position.
You can use this CC-Falloff combo map as a mask for any other map in your own scene, hope this helps.

2022-08-26, 14:05:26
Reply #3

88qba88

  • Active Users
  • **
  • Posts: 81
    • View Profile
Here is my render with lights visible on the dark side of the earth.
I know that there are more lights turned on in cities and roads during nighttime as we (humanity) turn them on after dark but the effect on the bright side is so subtle it should work anyway :)
You can achieve the effect you are talking about in static render or animation if you use distance map for light intensity and as object choose sun - the distance for the dark part should be farther then center of the earth, "daylight" distance towards the sun - playing with the transition zone can even mimic effect of gradually turning the lights on on the sunrise/sunset zone :)

2022-08-26, 14:24:32
Reply #4

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9021
  • Let's move this topic, shall we?
    • View Profile
    • My Models
I didn't tried it myself, but it's probably possible to add UVW map with spherical mapping on the different channel and add look-at constraint to its gizmo. Then simple gradient ramp map would do anything you want.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-09-21, 09:50:29
Reply #5

Aram Avetisyan

  • Corona Team
  • Active Users
  • ****
  • Posts: 725
    • View Profile
Hi. Earth renderings became mainstream nowadays :)
The best way to do this is to use Falloff map, with Falloff type set to Towards/Away, Falloff Direction - Object. Then pick the Sun/Light source.
You can then control the Mix curve of Falloff map for better transition of dark and lit part on the sphere.
Hope this helps.
« Last Edit: 2022-09-21, 10:01:08 by Aram Avetisyan »
Aram Avetisyan | chaos-corona.com
Chaos Corona QA Specialist | contact us