PDA

View Full Version : suneffect? or what



mongoose
February 14th, 2018, 18:38
Have this on morning flights in ETO. TOW_ETO, and BoB indtalls with different effects in my D:/ETO install. ??

The first 3 have Ankor; the last doesn't/

ETO
http://www.sim-outhouse.com/sohforums/attachment.php?attachmentid=58102&stc=1


TOW_ETO
http://www.sim-outhouse.com/sohforums/attachment.php?attachmentid=58103&stc=1


BoB
http://www.sim-outhouse.com/sohforums/attachment.php?attachmentid=58104&stc=1

D:/ETO
http://www.sim-outhouse.com/sohforums/attachment.php?attachmentid=58105&stc=1

MajorMagee
February 15th, 2018, 00:01
Yes, the controlling parameters are in the first section of the suneffect.xml file.

ndicki
February 15th, 2018, 02:25
Never mind "Beware of the Hun in the sun," it's "Beware of the Hun in the entire bloody screen!"

What part of suneffect.xml does one have to fiddle with to bring it back to something rather less apocalyptic?

AnKor
February 15th, 2018, 06:40
Unfortunately I can't help with this.
I know my shaders tend to exaggerate the sun like this with some suneffect settings, but I don't know which ones. I coded this long ago and don't really remember details.

gecko
February 15th, 2018, 07:03
Depends on which sun effect you are using. If it's one of mine, they were made before Ankor's shaders and probably not optimized well for them. There are several others out there, experiment around and find one you like.

mongoose
February 15th, 2018, 07:12
The first 3 are from latest Ankor. The last is old pre Ankor but note double sun. Using Dan's from NEW_CFS3_Environment_v2.0_-ETO.zip was not much better. Is there a post somewhere on the controlling parameters, and can other folders or files effect this?

gecko
February 15th, 2018, 08:21
Try something like this:
<SunGlare Size="0.2" Location="1.0" Intensity="0.25" Red="255" Green="186" Blue="186" Texture="corona.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.075" Location="1.0" Intensity="0.6" Red="255" Green="200" Blue="200" Texture="sun_glare_c.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<Corona Texture="orb.dds" Size="0.022" Intensity="0.002" BlendMode="1" UpAlign="1"/>
<SunImage Texture="sun.dds" Size="0.026" Intensity="0.80" BlendMode="1"/>
<WhiteOut MaxAngle="65" Red="255" Green="255" Blue="255"/>

This will give a toned down version of my old one. Ensure you have the textures installed, which can be found in my Environment effects package. If you want to further tweak it, adjust the "Size" parameter for the different textures.

mongoose
February 15th, 2018, 14:37
Not having much luck here. Dan. your suggestions seesm a lot shorter than the original.
Original
<SunGlare Size="3.7" Location="1.00" Intensity="0.4" Red="255" Green="255" Blue="224" Texture="sun_glare_d.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0" UpAlign="1"/>
<SunGlare Size="0.18" Location="1.00" Intensity="0.26" Red="255" Green="255" Blue="224" Texture="sun_glare_b.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0" UpAlign="1"/>
<SunGlare Size="0.25" Location="1.00" Intensity="0.32" Red="255" Green="255" Blue="224" Texture="sun_glare_c.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0" UpAlign="1"/>
<SunGlare Size="0.15" Location="1.00" Intensity="0.15" Red="255" Green="255" Blue="224" Texture="sun_glare_a.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0" UpAlign="1"/>
<Corona Texture="sun_corona_d.dds" Size="0.8" Intensity="0.001" BlendMode="1" UpAlign="1"/>
<SunImage Texture="sun_main.dds" Size="0.033" Intensity="3.30" BlendMode="1"/>
<WhiteOut MaxAngle="75" Red="173" Green="173" Blue="152"/>

your amendment

SunGlare Size="0.2" Location="1.0" Intensity="0.25" Red="255" Green="186" Blue="186" Texture="corona.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.075" Location="1.0" Intensity="0.6" Red="255" Green="200" Blue="200" Texture="sun_glare_c.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<Corona Texture="orb.dds" Size="0.022" Intensity="0.002" BlendMode="1" UpAlign="1"/>
<SunImage Texture="sun.dds" Size="0.026" Intensity="0.80" BlendMode="1"/>
<WhiteOut MaxAngle="65" Red="255" Green="255" Blue="255"/>


Result below

http://www.sim-outhouse.com/sohforums/attachment.php?attachmentid=58137&stc=1
also have a "cloud bank 360 degrees


http://www.sim-outhouse.com/sohforums/attachment.php?attachmentid=58138&stc=1


If I use an old ETO sun effect from my D drive

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by Jef Johnstone (Micrsoft) -->
<!--Lens Flare info-->
<SunEffect OcclusionSize="0.1">
<EnvironmentMap SunAngle="-7" />

<SunGlare Size="0.15" Location="1.00" Intensity="0.7" Red="255" Green="255" Blue="255" Texture="corona1.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.10" Location="0.70" Intensity="0.1" Red="255" Green="255" Blue="255" Texture="flare2.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.10" Location="0.50" Intensity="0.3" Red="255" Green="255" Blue="255" Texture="flare1.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.04" Location="0.20" Intensity="0.1" Red="255" Green="255" Blue="255" Texture="flare2.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.03" Location="-0.05" Intensity="0.1" Red="255" Green="255" Blue="255" Texture="flare1.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.07" Location="-0.25" Intensity="0.0" Red="255" Green="255" Blue="255" Texture="flare5.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.02" Location="-0.40" Intensity="0.0" Red="255" Green="255" Blue="255" Texture="flare1.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.02" Location="-0.60" Intensity="0.0" Red="255" Green="255" Blue="255" Texture="flare3.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.01" Location="-0.80" Intensity="0.0" Red="255" Green="255" Blue="255" Texture="flare2.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunGlare Size="0.08" Location="-1.00" Intensity="0.0" Red="255" Green="255" Blue="255" Texture="flare6.dds" u1="0.0" v1="0.0" u2="1.0" v2="1.0"/>
<SunImage Texture="sun.dds" Size="0.04" BlendMode="1"/>
<Corona Texture="corona.dds" Size="0.045" BlendMode="1" UpAlign="1"/>
<WhiteOut MaxAngle="80" Red="133" Green="129" Blue="113"/>

I get a double sun effect but otherwise better. NO ANKOR

http://www.sim-outhouse.com/sohforums/attachment.php?attachmentid=58139&stc=1

MajorMagee
February 15th, 2018, 16:45
The "double sun" is supposed to simulate the lens flare that can occur inside a camera.

The horizon cloud is an artifact of the fog color in the weather file you're using.

The suneffect.xml I provided to go with the AnKor package attempts to produce the blinding effect of looking directly at the sun before your eyes have a chance to adjust, and eliminates the artificial lens flare.

gecko
February 15th, 2018, 17:29
That's a lot brighter than what I get using those lines, I'm not sure why? At any rate, if you make the size values smaller it will be less overpowering. There are fewer lines because there is no lens flare.

MajorMagee
February 15th, 2018, 17:56
As far as I can tell AnKor has hard coded the underlying size of the sun.

Changing the value for it in the suneffect.xml makes a visible difference only if you toggle the shaders off.

With the shaders toggled on none of the parameters in the Shaders30 fx files related to displaying the sun seem to have an effect on the sun's size.

The glare added by the entries in suneffect.xml does have an effect so you can make the bright area surrounding the sun larger, but there is a minimum that you cannot get below even if you delete them all.

In looking at this again in the game, I think it's actually a fair simulation of being blinded when you look at the sun. Looking a bit away, and the glare tones down. If you pass into a shadow cast by your wingman, the surrounding glare provided by the suneffect.xml shrinks away, and just the core brightness is seen glinting around the edge of the shadow.

AnKor
February 16th, 2018, 01:07
As far as I can tell AnKor has hard coded the underlying size of the sun.
Yes, it is likely hardcoded. It still does depend on SunEffect somehow, but I don't remember how. The sun is not that big, but there are multiple layers of glare which tend to become a white ball of light when combined.

If you feel like editing shaders directly I think this may help.
Skybox.fx line 163:

Diffuse =
(1.0 * vSunScreenPos.w * (1.0 - smoothstep(1.2, 1.5, max(abs(vSunScreenPos.x),abs(vSunScreenPos.y))))) * Occlusion
* In.Diffuse;// float4(pow(length(In.Diffuse.rgb), 2) * normalize(In.Diffuse.rgb), In.Diffuse.a);
Try changing the first 1.0 to a lower value, like 0.8 or 0.5, so that it reads like:

Diffuse =
(0.8 * vSunScreenPos.w ...etc
I'm not 100% sure it is the solution, but I vaguely recall experimenting with that multiplier until I just left it as 1.0 (but forgot to remove).
I should have written some comments in the code about what each formula does :)

MajorMagee
February 16th, 2018, 03:04
Yes, that's one of the things I tried when I concluded that it was hard coded. That same multiplier term is set to lower values in the parts of the skybox.fx file that generates fog effects so it looks like it serves a purpose for setting the relative difference from clear to foggy skies.

I also tried changing static const float SunSize = tan(3.5 / 180.0 * 3.141593);
to static const float SunSize = tan(0.53 / 180.0 * 3.141593); (The angular size of the sun from the earth is 0.53 degrees)
but that also did not change the sun's size in game.

AnKor
February 16th, 2018, 05:07
That SunSize parameter is only for occlusion calculations, i.e. it defines the area of the sky which is tested for cockpits parts (other airplanes, etc) which could reduce the glare.
Setting it too low will just make transition from blinding sun to normal more abrupt. Setting it too large will likely reduce the contribution of shadows so that the glare will appear even if the sun is occluded.

And again I don't remember why it is set like this but it was mostly trial and error. The skybox shader is full of this, I tried a lot of things until it looked good enough and never returned to make it sane :)

MajorMagee
February 16th, 2018, 06:18
I agree that it looks pretty good where you ended up with it. Thank you again for all that you've done for this community!

mongoose
February 16th, 2018, 11:01
...................

The horizon cloud is an artifact of the fog color in the weather file you're using.

The suneffect.xml I provided to go with the AnKor package attempts to produce the blinding effect of looking directly at the sun before your eyes have a chance to adjust, and eliminates the artificial lens flare.


Well I'm still working on what for me is an acceptable sun effect by using various versions of the file I have lying around and keeping with Ankor shaders. However, re horizon cloud, do you mean my choice of weather in QC or just the particular weather folder I am using, or both?

MajorMagee
February 16th, 2018, 12:35
The xml files in the Weather folder have a parameter near the top called fogColor. It uses a 10 number sequence to define it's color. This is a decimal that converts to hexidecimal as FF followed by the Red, Green and Blue color values as numbers from 00 (darkest) to FF (lightest). A pure gray would have R = G = B. For example my scatteredclouds4low.xml has the BackgroundWeather fogcolor as 4288789972 which converts to FF A1 BD D4 which is a light blue grey R=161, G = 189, B = 212. The choice of this shade will have a significant impact on how well the fog will blend into the skybox background colors. AnKors latest shaders address the grey band that frequently was seen along the horizon, but they cannot completely make up for poorly matched fog/skybox colors.

For the skyboxes I use the optimal values are:
NoClouds = 4288789972
FewClouds = 4288789716
ScatteredClouds = 4287013048
BrokenClouds = 4290432475
ThickClouds = 4285757562

Pure bright white is 4294967295.

mongoose
February 16th, 2018, 14:45
I'll have a look at that but also discovered in my Weather folder 2 "clear" weathers; '0clear' and 'clear'.
The former is
<Weather Name="Clear">
<BackgroundWeather skyboxCloudType="NoClouds" MaxAltitude="0" MinAltitude="0" fogColor="14935039" Windspeed="0" windDir="0" >
</BackgroundWeather>
</Weather>


and the latter
<Weather Name="Clear">
<BackgroundWeather skyboxCloudType="NoClouds" fogColor="4288332017" Windspeed="0" windDir="0" >
</BackgroundWeather>
</Weather>


I do note the fogColor is the main difference but not sure why 0clear has 'MaxAltitude="0" MinAltitude="0" '

Also not sure where that file came from; other than the "0" makes it appear first in the list!

Back to your comments, are you saying that when you have skyboxCloudType="NoClouds" your fogColor is 4288789972, and so on?

MajorMagee
February 16th, 2018, 19:41
Yes. AnKor's shaders then combine that with the shade of the skybox file along the horizon to smooth the transition from land to sky without having a sharp line form. The viewing altitude also makes a difference as to how high in the sky that the transition appears.

There is a setting in the weather xml files called skyboxcloudType that can have a few different predefined descriptions:
NoClouds (and ThinClouds) will display the clear_bk, _fr, _up, _dn, _lf, and _rt textures from the effects\skybox folder
FewClouds will display the cirrusonly_bk _fr, _up, _dn, _lf, and _rt textures from the effects\skybox folder
ScatteredClouds will display the scatteredclouds_bk, _fr, _up, _dn, _lf, and _rt textures from the effects\skybox folder
BrokenClouds will display the lowcumulusonhorizon_bk, _fr, _up, _dn, _lf, and _rt textures from the effects\skybox folder
ThickClouds will display the grayhorizon_bk _fr, _up, _dn, _lf, and _rt textures from the effects\skybox folder
If you don't have it explicitly defined in the weather xml file it seems to default to the NoClouds version.