Jump to content

[SOLVED] Moon is fading out too fast


photo

Recommended Posts

Posted (edited)

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
Posted

Hi Sebastian,

Could you please send us a simple test scene with your modified moon? It will be easier to provide a feedback if we can run and debug this behavior on our side.

Thanks!

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

Posted

Here is a sample world file with moon and sun in a 55 degree angle. The moon is too dark. Intensity can be increased over environment settings but it gets too bright when angle reaches more than 90 degrees.

moon_brightness.world

Posted

Hi Sebastian,

It looks like some dependencies missing (we don't see any issues with moon in this world). Could you please send us additional logic that you implemented plus and modified moon textures (if any).

Thanks!

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

Posted

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

Posted

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.

Posted

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.

Posted

Hi Sebastian,

Currently there are two ways:

  1. Use billboard instead of built-in object;
  2. Modify shader

We will keep in mind this use-case and will try to fix in the upcoming SDK updates.

Thanks!

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

Posted

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

Posted

Hi Sebastian,

We can provide you a fix at the middle (worst case scenario - at the end) of next week. Right now all the rendering devs are quite busy. Could you please tell us if you can accept such delay?
 

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

Posted

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.

 

Posted

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:

Posted

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
Posted (edited)

Different moon phases over month, daytime and sunset:

moon011.png

moon010.png

Edited by sebastian.vesenmayer
  • Like 2
  • silent changed the title to [SOLVED] Moon is fading out too fast
×
×
  • Create New...