sebastian.vesenmayer Posted February 26, 2019 Share Posted February 26, 2019 (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 Edited February 26, 2019 by sebastian.vesenmayer Link to comment
silent Posted February 27, 2019 Share Posted February 27, 2019 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted February 27, 2019 Author Share Posted February 27, 2019 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 Link to comment
silent Posted February 28, 2019 Share Posted February 28, 2019 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted February 28, 2019 Author Share Posted February 28, 2019 Hi, It is just simple as: Create a new unigine project with 2.7.2 Add a new light world object and call it moon Set moon scattering on the moon object Set rotation angles for sun object x=140 y=0 z=0 Set rotation angles for moon object x=85 y=0 z=0 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 Link to comment
cash-metall Posted February 28, 2019 Share Posted February 28, 2019 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
sebastian.vesenmayer Posted February 28, 2019 Author Share Posted February 28, 2019 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
silent Posted March 1, 2019 Share Posted March 1, 2019 Hi Sebastian, Currently there are two ways: Use billboard instead of built-in object; 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted March 1, 2019 Author Share Posted March 1, 2019 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
silent Posted March 1, 2019 Share Posted March 1, 2019 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted March 1, 2019 Author Share Posted March 1, 2019 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
silent Posted March 6, 2019 Share Posted March 6, 2019 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted March 6, 2019 Author Share Posted March 6, 2019 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. 1 Link to comment
sebastian.vesenmayer Posted March 6, 2019 Author Share Posted March 6, 2019 (edited) Different moon phases over month, daytime and sunset: Edited March 6, 2019 by sebastian.vesenmayer 2 Link to comment
Recommended Posts