Fresnel reflection is not supposed to reflect black space like that, only metallic reflections are.
jarmonik: Is there any way yo could give the planet-shine a boost in the light level? Currently, it's too dark when compared to real photos/videos.
I have it at max 1.0 and it is still too dark. Compare it a photo such as this one of Endeavour during STS-134: http://spaceflight.nasa.gov/gallery/images/shuttle/sts-134/hires/s134e006936.jpgThere's a Planet Glow setting under the "Advanced" button of the Video tab. It gives you lots of settings you can adjust for D3D9. I think it's normally set to 0.5, but I prefer it brighter too, and set it to 0.75.
In real life, Fresnel reflections do act that way, the same way as metallic reflections. If you pick up a smooth non-metallic object that has a Fresnel reflection (like a credit card) and look at it edge-on, it reflects the environment behind it (both light and dark) as the angle goes to zero. Even a white object like a smooth dinner plate becomes dark when viewed edge-on against a dark background.
In the posted Orbiter screenshots, the difference is shown between using cRefl.rgba ("A") and cRefl.rgb ("B") at three different settings. "A" looks more realistic than "B".
cRefl.rgba = cRefl.rgba * (1.0f - fresnel) + fresnel;
cRefl.rgba *= fresnel;
I have it at max 1.0 and it is still too dark. Compare it a photo such as this one of Endeavour during STS-134: http://spaceflight.nasa.gov/gallery/images/shuttle/sts-134/hires/s134e006936.jpg
I have it at max 1.0 and it is still too dark. Compare it a photo such as this one of Endeavour during STS-134: http://spaceflight.nasa.gov/gallery/images/shuttle/sts-134/hires/s134e006936.jpg
In that case the material "reflect" property would need to be set to [1,1,1] by default. Setting the fresnel "offset" to 1 would create a mirror like reflection and setting both "offset" and "multiplier" to zero would disable reflections.
Would that be a better approximation ? But how does it work with reflection maps ?
cRefl.rgb = cRefl.rgb + (cRefl.a != 0) * saturate(gMtrl.fresnel.y - cRefl.a) * pow(1.0f-saturate(dot(CamW, nrmW)), gMtrl.fresnel.z);
cRefl.a = max(cRefl.r,max(cRefl.g,cRefl.b));
float fresnel = gMtrl.fresnel.y * pow(1.0f-saturate(dot(CamW, nrmW)), gMtrl.fresnel.z);
cRefl.rgba = cRefl.rgba + (cRefl.a != 0) * (1.0f - cRefl.rgba) * float4((cRefl.rgb / cRefl.a) * fresnel, fresnel);
If the reflect property is set to [1,1,1] by default, then that would be the same as saying cRefl.rgba = fresnel.
They both have the (cRefl.a != 0) term, which masks off Fresnel reflections where the cRefl.a is 0.
cRefl.rgba *= fresnel
They both incorporate the cRefl.rgb color into the Fresnel reflection. This would be handy when drawing a gold foil patch inside a regular glossy paint area, to keep the gold from getting a white Fresnel reflection.
cRefl.rgba *= fresnel
Actually no, I was saying that [1,1,1] would be a default seting for any new material create with the material editor. It would not be hardcoded to that value. So, if there is a reflection map then cRefl.rgba would come from a map.
cRefl.rgba += fresnel; // metallic parts are oversaturated with fresnel
cRefl.rgba = saturate(cRefl.rgba + fresnel); // metallic parts fixed
cRefl.rgba = saturate(cRefl.rgba + (cRefl.a > 0) * fresnel); // Fresnel masked by 0,0,0
cRefl.rgba = saturate(cRefl.rgba + float4((cRefl.a > 0) * (cRefl.rgb / cRefl.a) * fresnel, fresnel)); // Fresnel uses cRefl.rgb for color
PHP:cRefl.rgba = saturate(cRefl.rgba + float4((cRefl.a > 0) * (cRefl.rgb / cRefl.a) * fresnel, fresnel)); // Fresnel uses cRefl.rgb for color
cRefl.rgba = saturate(cRefl.rgba + (cRefl.a > 0) * float4((cRefl.rgb / cRefl.a) * fresnel, fresnel));
That should fit within 64 instructions but the fresnel reflection model is somewhat flawed. For an example if you want to create a reflection for a window then you must specify a near zero reflection color otherwise the reflection won't show up. Also, if you wan't to specify a color for a fresnel reflection, it is a little difficult to do using a near zero values in a material editor. Unless we change it to use a normalized color and intensity.
I forgot to move the (cRefl.a > 0) term outside the float4(). It should be instead:
Otherwise, masked regions without Fresnel would fade to black as Fresnel reflections increase. The alpha channel wasn't being masked.PHP:cRefl.rgba = saturate(cRefl.rgba + (cRefl.a > 0) * float4((cRefl.rgb / cRefl.a) * fresnel, fresnel));
So, that is your recommendation. Do you realise, once implemented, it won't be changed again. Since, every change has a potential chance to break existing add-ons like in this case.
cRefl.rgba = saturate(cRefl.rgba + (cRefl.a > 0) * fresnel);
Hey jarmonik, realize you are trying to wind down the project. Just wondering if you had a chance to take a look at this issue & whether it will be addressed before final release of the client.
Just asking from an awareness standpoint. Please don't take this as a nag or a demand. Just wondering, since I'm working on the vessel anyway, do I need to try and find a workaround on my end?
Thanks,
n122vu
Material specs:
MATERIAL <mtrl-name> material header
<dr> <dg> <db> <da> Diffuse colour (RGBA)
<ar> <ag> <ab> <aa> Ambient colour (RGBA)
<sr> <sg> <sb> <sa> <pow> Specular colour (RGBA) and specular power (float)
<er> <eg> <eb> <ea> Emissive colour (RGBA)
On another topic, way back in R5b from September 2012, I was able to make normal maps for base tiles and have them take effect in Orbiter. I recently tried again in R11 from March 18, and I can't get it to work. Am I using the wrong texture format (rgb8)?