New Release D3D9Client Development

Noeyedeer

New member
Joined
Jun 20, 2013
Messages
14
Reaction score
0
Points
0
Location
Atlanta
D3D9 Crashes.

Every time I try to run Orbiter in D3D9 client it says "Critical error has occured. See orbiter.log for details." So I pull up orbiter.log with the notepad and it says:
D3D9Client:WARNING: [Hardware has only a limited non-power of 2 texture support]
D3D9Client:WARNING: [Insufficient Vertex Shader. Attempting software vertex processing...]
D3D9Client:WARNING: [Not a pure device]
D3D9Client:WARNING: [No Hardware T&L]
D3D9Client:WARNING: [No Hardware MipMap auto generation]
I have no clue what this means and how to fix the problem.
 

Noeyedeer

New member
Joined
Jun 20, 2013
Messages
14
Reaction score
0
Points
0
Location
Atlanta
What is your graphics card?
I'm not very good at computers so I think by graphics card you mean 3d device as shown in the video section of the launchpad.
If so: Mobile Intel(R) 945 Express Chipset Family
Not the best so I won't be too surprised if d3d9 won't work on my computer.
 

jbsheridan

New member
Joined
Jan 10, 2011
Messages
46
Reaction score
0
Points
0
Jarmonik,


Yes, the black flickering occurs with the Rendering set to Disable.


Thanks,
jb
 

SolarLiner

It's necessary, TARS.
Addon Developer
Joined
Jun 14, 2010
Messages
1,847
Reaction score
2
Points
0
Location
404 ROAD NOT FOUND
I have a little problem with R11: When the spacecraft main engines are on, those faces that are lit by the engine flames, are flickering, (the faces getting inverted, or it's just becomes black, i don't know, i can't really see as it happens fast, and randomly). Why is that?

If I can quote this (because it's a bit old post), I say that this local light sources flickering happens to me, but not for the DG engines (why? I don't know), but for every other types of local lights (example for the PBLights of the Shuttle Fleet)

I have an ATI Radeon HD 5700, and it does happen when I remove every reflections from the ships.
 

astrosammy

Dash!
Addon Developer
Donator
Joined
Apr 27, 2008
Messages
2,124
Reaction score
0
Points
36
Location
ICAO ID: EDFB
If I can quote this (because it's a bit old post), I say that this local light sources flickering happens to me, but not for the DG engines (why? I don't know), but for every other types of local lights (example for the PBLights of the Shuttle Fleet)

I have an ATI Radeon HD 5700, and it does happen when I remove every reflections from the ships.

Are you talking about DG-IV? It doesn't have engine lights.
I played with all settings, it's happening always.
 
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
Here is a new build of the client for testing the lighting issue. I have no idea what's wrong with the local lights and I can't reproduce the problem and I can't find anything wrong from the code. So, if you could test the new build and see if it still produces the local lights problem.

If the problem is still present.
1) Then find D3D9Client.fx file from /Modules/D3D9Client/
2) Locate the following code section

PHP:
void LocalVertexLight(out float4 diff, out float4 spec, out float4 dir, in float3 nrmW, in float3 posW)
{
    float3 diffuse = 0;
    float3 specular = 0;
    float3 direction = 0;

    int i;
    for (i=0;i<gLightCount;i++) 
    {
        float  dist  = distance(posW,gLights[i].position);
        float3 relpW = normalize(posW-gLights[i].position);

        float att    = saturate(1.0f / (gLights[i].attenuation[0] + gLights[i].attenuation[1]*dist + gLights[i].attenuation[2]*dist*dist));
        float spt    = saturate((dot(relpW, gLights[i].direction)-gLights[i].param[Phi]) * gLights[i].param[Theta]);
        
        float d      = saturate(dot(-relpW, nrmW));
        float s      = pow(saturate(dot(reflect(relpW, nrmW), normalize(-posW))), gMtrl.specular.a);

        if (gMtrl.specular.a<2.0 || d==0) s = 0.0f;
        if (gLights[i].type==1) spt = 1.0f;         // Point light -> set spotlight factor to 1

        float dif = (att*spt);

        diffuse   += gLights[i].diffuse.rgb * (dif * d);
        specular  += gLights[i].specular.rgb * (dif * s);
        direction += relpW * (dif * d);
    }  
   
    diff = float4(1.5 - exp(-1.0*diffuse.rgb)*1.5, 0);
    spec = float4(1.5 - exp(-1.0*specular.rgb)*1.5, 0);
    dir  = float4(normalize(direction), 0);
}

and replace it with this one

PHP:
void LocalVertexLight(out float4 diff, out float4 spec, out float4 dir, in float3 nrmW, in float3 posW)
{
    float3 diffuse = 0;
    float3 specular = 0;
    float3 direction = 0;

    int i;
    for (i=0;i<gLightCount;i++) 
    {
        float  dist  = distance(posW,gLights[i].position);
        float3 relpW = normalize(posW-gLights[i].position);

        float att    = saturate(1.0f / (gLights[i].attenuation[0] + gLights[i].attenuation[1]*dist + gLights[i].attenuation[2]*dist*dist));
        float spt    = saturate((dot(relpW, gLights[i].direction)-gLights[i].param[Phi]) * gLights[i].param[Theta]);
        
        float d      = saturate(dot(-relpW, nrmW));
        float s      = pow(saturate(dot(reflect(relpW, nrmW), normalize(-posW))), gMtrl.specular.a);

        if (gMtrl.specular.a<2.0 || d==0) s = 0.0f;
        if (gLights[i].type==1) spt = 1.0f;         // Point light -> set spotlight factor to 1

        float dif = 1.0;

        diffuse   += float3(1,1,1) * (dif * d);
        specular  += float3(1,1,1) * (dif * s);
        direction += relpW * (dif * d);
    }  
   
    diff = float4(1.5 - exp(-1.0*diffuse.rgb)*1.5, 0);
    spec = float4(1.5 - exp(-1.0*specular.rgb)*1.5, 0);
    dir  = float4(normalize(direction), 0);
}

After making the change, local lights won't work properly. (color and distance attenuation is gone) But does it remove the "black" artifacts from the local lights ?

There is also a frame rate limiter added. The first parameter in D3D9Client.cfg. Zero will disable the limiter, also a low values will produce a lot of tearing so a minimum practical value is about 200. (This is unrelated to the lighting issue)
 

Attachments

  • D3D9ClientR11c.zip
    1.2 MB · Views: 61
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
Any feedback ?
 

Cras

Spring of Life!
Donator
Joined
Apr 13, 2011
Messages
2,215
Reaction score
0
Points
36
Location
Los Angeles
Website
www.youtube.com
Any feedback ?

I have tried the new build, i cannot speak of the local light issue however, I never saw that myself.

Would it be possible to add like, a trigger for the frame limiter inside the sim? Like as part of the debugger window?
 

astrosammy

Dash!
Addon Developer
Donator
Joined
Apr 27, 2008
Messages
2,124
Reaction score
0
Points
36
Location
ICAO ID: EDFB
Oh, sorry jarmonik, I tried it after you posted R11c, just forgot to post my results.

The local lights work perfectly. I did not have to replace the code section you posted above.
Thanks for the fix!
 

Kendo

New member
Joined
Oct 16, 2007
Messages
589
Reaction score
1
Points
0
Works fine here, without the code. :hello: :thumbup:
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
D3D9Client R12

Here is R12 release. If everything is alright then I'll upload it to CodePlex.
 

Attachments

  • D3D9ClientR12.zip
    1 MB · Views: 87

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
Would it be possible to add like, a trigger for the frame limiter inside the sim? Like as part of the debugger window?

I'll try to include that in the next release. The status of the debug controls isn't saved anywhere. Therefore, you would need to enable it every time when the simulation is started. I'll try to find some better way to do that.
 
Top