Jump to content

[SOLVED] Moon is fading out too fast


photo

Recommended Posts

Hi,

I implemented a lunar cycle and the rotation of sun and moon are working fine.

What I noticed is that the moon fades out way too fast, when the angle between sun and moon is smaller than 90 degrees.

How can I change this behavior?

Thanks,

Sebastian

halfmoon.PNG

halfmoon2.PNG

Edited by sebastian.vesenmayer
Link to comment

Hi,

It is just simple as:

  1. Create a new unigine project with 2.7.2
  2. Add a new light world object and call it moon
  3. Set moon scattering on the moon object
  4. Set rotation angles for sun object x=140 y=0 z=0
  5. Set rotation angles for moon object x=85 y=0 z=0
  6. You will barely see the moon

It has nothing todo with custom textures, I just used unigine intern assets and get the same results.

I added a picture of a waxing crescent moon, so you have an idea how the intensity on the lit part should look like.

Thanks

 

moon.png

moon3.PNG

Link to comment

This was made specifically to simulate the new moon. 

When the moon is at low angles from the sun - this is the new moon. in the new moon we do not see the moon, or we see a very small piece of it. The moon is turned to us by the shadow side. 

I agree, not a very good solution. I could not find a way to turn off this effect. We put this problem in backlog.  

Perhaps, if you really need a realistic moon, you need to use a billboard with emission.

Link to comment

Hi,

I just had a look at the shader "environment.frag" and noticed that the mie alpha value is the most influencing factor.

Is it possible to change the mie LUT so I don't need to use the customized shader?

Thanks.

Link to comment

Hi,

Is a transparent Billboard blending correctly with cloud layers? We already saw issues with transparent materials when they are behind clouds.

 

Maybe I can change a LUT can you tell me which Texture it is in the TEX_SKY_LUT texture array in the environment.frag because the mie.a value is the most influencing factor?

I also need the texture area which will be samped for the moon mie close to the sun.

	// moon
	mie = TEXTURE_ARRAY(TEX_SKY_LUT, uv, 2,0);
	
	#ifdef SKY
		tex = float4_zero;
		
		ACCUM_TEXTURE_DISK_PRESET(0, moon, TEX_MOON_);
		ACCUM_TEXTURE_DISK_PRESET(1, moon, TEX_MOON_);
		ACCUM_TEXTURE_DISK_PRESET(2, moon, TEX_MOON_);
		
		tex_factor = tex.rgb * tex.a * mie.a;
	#endif

Is it the MIE Texture?

If it is, have you more information about its functionality and how it influences shading of the texture especially the angle to the sun (about 1 page and not just a 1 liner, everything that comes in your mind).

Thanks

Link to comment

Hi,

it is not a time critical item at the moment. Please let me know when you have more information, which answers my questions :)

Thanks.

 

Link to comment

Hi Sebastian,

We've slightly modified scattering LUT shader, please replace the core\shaders\screen_space\environment\scattering_lut.frag with the attached file to see the difference. Will this result match your expectations for moon lightning? 

Thanks!

scattering_lut.frag

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hi,

that was the hint I needed.

Wrong shader version but i ported it to 2.7.2.

I think to simply take the dot product is the problem. I multiplied the greyvalues from the light and mie of the sun to it because the sky and sun color has much influence.

Now I get better results I will post screenshots later.

Maybe you can use an advanced version of it in later releases.

	#ifdef WORLD_LIGHT_SUN
        float3 outLightSun=OUT_MRT(OUT_LIGHT_SUN).rgb;
        float3 outMieSun=OUT_MRT(OUT_MIE_SUN).rgb;
		OUT_MRT(OUT_MIE_MOON) *= 1.0f - ((dotFixed(s_scattering_sun_dir, s_scattering_moon_dir)) * (outMieSun.r + outMieSun.g + outMieSun.b) * 0.33333);
		OUT_MRT(OUT_LIGHT_MOON) *= 1.0f - ((dotFixed(s_scattering_sun_dir, s_scattering_moon_dir)) * (outLightSun.r + outLightSun.g + outLightSun.b) * 0.33333);
	#endif

Thank you for your help.

  • Like 1
Link to comment
  • silent changed the title to [SOLVED] Moon is fading out too fast
×
×
  • Create New...