New Release D3D9Client Development

D3D9Client R11 RC5

Here is RC5 for testing. Let's see if the reflections and everything else is working as supposed to and after that I'll upload an official R11 release.

The package contains a Release build and a Debug build of the client. In a case of CTD or other problems, use the debug build to include more debug information in the output.
 

Attachments

Here is RC5 for testing. Let's see if the reflections and everything else is working as supposed to and after that I'll upload an official R11 release.

The package contains a Release build and a Debug build of the client. In a case of CTD or other problems, use the debug build to include more debug information in the output.
No issues to report. Everything is running very smoothly here. So what about the self-shadowing? A NO-GO?
 
From my knowledge self shadowing (at least with shadowmap technique) requires another render pass to create shadow maps to be apllied to objects later.
 
So what about the self-shadowing? A NO-GO?

I don't have time right now and the summer is coming. Also, I need to study different kind of implementation techniques. Of course, a simple non-cascaded shadow map should be easy to implement but I am concerned about the quality. It's possible to try it at first before attempting to do anything more complex. I am looking into it but don't expect results anytime soon.
 
I don't have time right now and the summer is coming. Also, I need to study different kind of implementation techniques. Of course, a simple non-cascaded shadow map should be easy to implement but I am concerned about the quality. It's possible to try it at first before attempting to do anything more complex. I am looking into it but don't expect results anytime soon.
What kind of quality are we talking about? Blocky and really not good?
 
From my knowledge self shadowing (at least with shadowmap technique) requires another render pass to create shadow maps to be apllied to objects later.
Yes. But you would need multible shadow maps. High resolution map near the camara and lower resotution maps further away from the camara. (These are called cascades). Also, in the orbiter the camara aperture can change is very large scale where as in the computer games it usually fixed.

---------- Post added at 17:45 ---------- Previous post was at 17:42 ----------

What kind of quality are we talking about? Blocky and really not good?
I don't know. I'll try to run some demo programs and take a screen shots. That might give some answers.
 
Yes. But you would need multible shadow maps. High resolution map near the camara and lower resotution maps further away from the camara. (These are called cascades). Also, in the orbiter the camara aperture can change is very large scale where as in the computer games it usually fixed.

So it's even more complicated than I thought. :P

I've done rendering test with light placed ~2.4 km from object for four shadow map resolutions.

Effect is clearly visible:
shadows.jpg
 
So it's even more complicated than I thought. :P
I've done rendering test with light placed ~2.4 km from object for four shadow map resolutions.
Effect is clearly visible:
In those screen shots the shadow map is applied to full scene. How about just applying it in vessel's bounding sphere ?
How does it look like after bringing the camera about 1 meter away from the vessel's hull ?

If a space shuttle is about 37 meters long and we have a shadow map of 2048x2048 pixels then one pixel would be about 2cm. So, that would be the size of a shadow "element" in the most simplest case. I suppose we could compare this to the resolution of textures used in a vessels.
 
Last edited:
I don't have time right now and the summer is coming. Also, I need to study different kind of implementation techniques. Of course, a simple non-cascaded shadow map should be easy to implement but I am concerned about the quality. It's possible to try it at first before attempting to do anything more complex. I am looking into it but don't expect results anytime soon.

Are you still considering creating a wholly separate space simulator as mentioned earlier in this thread?
 
In those screen shots the shadow map is applied to full scene. How about just applying it in vessel's bounding sphere ?
How does it look like after bringing the camera about 1 meter away from the vessel's hull ?

If a space shuttle is about 37 meters long and we have a shadow map of 2048x2048 pixels then one pixel would be about 2cm. So, that would be the size of a shadow "element" in the most simplest case. I suppose we could compare this to the resolution of textures used in a vessels.

Hmm. As I'm using 3ds max for this experiments this time I replaced point light with "directional light" (all rays are parallel) placed much closer to the vessel and here is render with same shadowmap resolutions as previous.

local_shadows.jpg
 
I actually think that the 2048x2048 looks the best.
 
Hmm. As I'm using 3ds max for this experiments this time I replaced point light with "directional light" (all rays are parallel) placed much closer to the vessel and here is render with same shadowmap resolutions as previous.

Thank you, those are very helpful. Could you take a close-up shot from the ladder. (Let's say 2-3 meter distance using 2048x2048)

From this camera distance there are no problem but I am worried about the close-up shots when the camera is near the vessel. Also should be remembered that we can't use as advanced filters as the 3DS Max does. (Maybe 2x2 PCF)
 
Last edited:
First - light position:
(grey grid cell is 10 meter in size)

Light cylinder is 90 meter wide (to cover all the craft).

light-pos.jpg


Some shots at shadowmap 2048x2048

close01.jpg

close02.jpg

close03.jpg

close04.jpg



And shot with light 50 meter wide (2048px shadowmap):

close05.jpg
 
Last edited:
I don't know. Could you post some screen shots running the Orbiter with those shaders ?
I cant post any screen shots because I can not choose the shader in the lauchpad. I can't make the shaders work as I have no way of doing this. With the SweetFX shaders in the orbiter directory I am only allowed to choose Level20 and default.
 
I cant post any screen shots because I can not choose the shader in the lauchpad. I can't make the shaders work as I have no way of doing this. With the SweetFX shaders in the orbiter directory I am only allowed to choose Level20 and default.
Do you know what you are trying to do ? Can't you just backup the default shaders and replace them with yours. Or simply rename the shader folder.

---------- Post added at 20:01 ---------- Previous post was at 14:38 ----------

R11 release is now live on codeplex https://d3d9client.codeplex.com/
 
Do you know what you are trying to do ? Can't you just backup the default shaders and replace them with yours. Or simply rename the shader folder.

Tried everything I could think of renaming and such. No luck with SweetFX shaders.
 
RacerX. The idea of this is, the shaders are loaded automatically when the game starts and work along side the game. Totally separate to the D3D9 client. If the default inline client was DirectX9, it would pick it up.
I did get this working yesterday with the D3D9 client, and unistalled it to see if I could do it again, but alas I couldn,t.
I,m sure I put the d3d9.dll in the modules/plugin folder and enabled it through the Launchpad, along with the D3D9 client etc, and moved a couple of other files around.
It wrote to a log as it should.
 
I found that specular highlights have been overpowering the Fresnel reflections. This is a fix. I don't know if it breaks the instruction limit, though. It's relatively minor issue, so if it breaks it, it isn't that important.

PHP:
//    float3 cTot = cSpec.rgb * (frg.spec.rgb + s * gSun.specular.rgb);
    cRefl = float4(0,0,0,0);
    cTex.rgb += cSpec.rgb * (frg.spec.rgb + (s * gSun.specular.rgb));    
#if defined(_ENVMAP)    
    if (gEnvMapEnable) {        
        if (gUseRefl) cRefl = tex2D(ReflS, frg.tex0);                      
        else           cRefl = gMtrl.reflect;
        float fresnel = gMtrl.fresnel.y * pow(1.0f-saturate(dot(CamW, nrmW)), gMtrl.fresnel.z);        
        cRefl = saturate(cRefl + (cRefl.a>0)*fresnel);     
        cTex.rgb *= (1.0f - cRefl.a);                         
//        cTot.rgb += cRefl.rgb * texCUBE(EnvMapS, reflect(-CamW, nrmW)).rgb;
        cRefl.rgb *= texCUBE(EnvMapS, reflect(-CamW, nrmW)).rgb;         
    }
#endif
//    cTex.rgb += cTot.rgb;                                // Apply reflections
    cTex.rgb += cRefl.rgb;
Sorry I didn't post this over the weekend before R11- I was out all day yesterday and this morning.
 
Back
Top