So I want the radiator panels of the shuttle to reflect with
this dark blue color at a high angle and
this more neutral white color at low angles. How can I accomplish this with D3D9Client R2? I had this working in an earlier beta of R2 before Felix's reflection map fix was incorporated.
In the "dark blue" photo, the radiators are fully lit by the sun light and they are reflecting nothing (just empty space). So, that photo should show a true diffuse color of the radiators and that's pretty much what the diffuse texture should be. On the other hand, in the "natural white" photo, the reflected color is pretty close to the color of the Earth that's being reflected. A viewing angle does have an effect to the reflected image (intensity, sharpness) but that's starting to become noticeable below 20 deg. So, neither photo should be effected by viewing angle dependencies.
A few words about the "Felix's Fix". If you create a gold foil texture for the DX7 inline engine, that texture would have pretty bright gold color applied to it. That's pretty much it when a renderer doesn't support reflections. However, in a reflective environment a diffuse color of a gold foil would need to be close to a black. And that's because of an energy conservation, if 75% of incoming light is reflected then only 25% of the incoming light can go through diffuse scattering. One purpose of the "Felix's Fix" is to avoid a need of a separate diffuse textures for DX7 and DX9, and an other is to prevent over powering/saturating the reflections.
The equation:
cDiff.rgb *= (1.0f - fRefl);
Will shift the color of the diffuse texture towards a black when the reflectivity "fRefl" increases. You didn't tell what's wrong with the current rendering of the radiators. But I would assume the color to be too dark. If the diffuse texture has the color and intensity shown in the "dark blue" photo then the "Felix's Fix" correction factor would not be needed and it's darkening something that's already correct.
There are a few quick tests you could try:
Remove/Comment out the line 365 from the PBR.fx:
//cDiff.rgb *= (1.0f - fTot);
If that doens't help then you could try to alter the line 369 to this:
cDiff.rgb *= (1.0f - fRefl*fRefl);
You can alter the brightness of the diffuse texture from the D3D9Mesh debugger by using "
Tune Albedo" property but that will of-course effect to the whole texture not just the selected group. "Tune X" features works only when the mesh debugger is open. Currently the diffuse material property can't be adjusted above above 1.0.
A few notes:
- It would be good idea to ask Felix's opinion about this.
- Fresnel behavior is not yet implemented and few other issues are still open.
- I am further looking into this matter.
- Might be good idea to wait a little with major texture works. Small changes in the rendering behavior can happen.