helmut.bressler Posted April 18, 2016 Posted April 18, 2016 Dear Unigine Team, the new Sky system looks great and really simpliefies the process of setting up a day and night cycle. Thank you a lot for bringing that into Unigine. (I think the biggest benefit is that the whole lighting for outdoor scenes looks consistent across a whole day just out of the box, there is no need to animate scattering settings and hdr exposure.) We have implemented our moon solution in a similar way as in the Oil platform demo, which is a billboard in front of the bright disc which comes from the nighttime scattering. For our taste, the moon billboard is too big at the moment. My question is, if it is possible to adjust the size of that disc somehow, because the billboard cannot become smaller than the disc (otherwise the moon would get a strange halo) Thank you very much Cheers Helmut
silent Posted April 19, 2016 Posted April 19, 2016 Hi Helmut, I'm afraid there is no possibility to change the moon disc size. Could you please share with us a screenshot with that halo? Also, why don't use the solution that already available (Valley / Oil Platform demos)? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
helmut.bressler Posted April 19, 2016 Author Posted April 19, 2016 Hello Silent, well, actually I think I explained a simple thing in a very complicated way :-) I would like to use a small billboard for the moon, smaller than the moon billboard in the oil platform demo. The moon disc size resulting from the scattering imposes a lower bound on the billboard size, which is still too big for our setting. I have attached two images from the moon, the first one contains a big moon billboard, which covers the entire disc . The second one shows the same scene with a very small moon billboard (the disc from scattering is not entirely covered here) . I'm afraid there is no possibility to change the moon disc size. That answers already my question, I just wanted to know if that is possible. Thank you very much again Silent, Helmut
silent Posted April 20, 2016 Posted April 20, 2016 Hi Helmut, You can try to play with magic numbers inside getScatteringMieDisk function at the core\shaders\common\scattering\common.h to adjust disc size and gradient. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
helmut.bressler Posted April 20, 2016 Author Posted April 20, 2016 Hello Silent, indeed, line 40 looks like pretty much what I'm looking for. In theory, I could remove the whole line, I shouldn't need the disk for the moon anyway. Before I can do that, I need something to distinguish between sun and moon scattering. I will see if I can find a define or something. Thank you very much again, Helmut
helmut.bressler Posted June 15, 2016 Author Posted June 15, 2016 Hello Silent, I just want to tell you that I have found a pleasing solution. I added a scattering disk function for the moon in \core\shaders\common\scattering\common.h: float getScatteringMieDisk_Moon(float3 light_dir,float3 camera_dir) { float3 camera_dir_offset = normalize(camera_dir + light_dir * 0.5f); float dotLD_offset = dotFixed(light_dir,camera_dir_offset); float dotLD = dotFixed(light_dir,camera_dir); float dotLUP = dot(light_dir,float3_up); float mie = getScatteringMie(dotLD_offset,dotLUP); // mie += saturate(pow(dotLD,250000.0f) * 20000.0f) * 0.25f; /////Moon Size return mie; } which hides the moon scattering disk completely. In core\shaders\screen_space\environment\environment.frag I invoke that new moon disc size function instead the default scattering disc size function: //sun #ifdef SKY float mie_factor = getScatteringMieDisk(s_scattering_sun_dir,camera_dir); #else float mie_factor = getScatteringMie(s_scattering_sun_dir,camera_dir); #endif float3 mie = TEXTURE_BIAS_ZERO(TEX_SKY_LUT,float3(uv,1.0f)).rgb; OUT_COLOR.rgb = lerp(OUT_COLOR.rgb,mie,mie_factor); //moon #ifdef SKY mie_factor = getScatteringMieDisk_Moon(s_scattering_moon_dir,camera_dir); #else mie_factor = getScatteringMie(s_scattering_moon_dir,camera_dir); #endif This way, I can adjust the size of the moon scattering disc without affecting the sun scattering disc size. Cheers, Helmut
Recommended Posts