New Release D3D9Client Development

Phoenix

New member
Joined
Nov 17, 2009
Messages
72
Reaction score
0
Points
0
The frame rate in the 2010 D3D9 client on my computer is usually about four to five times that of inline DX7. Unfortunately, with the 2014 client, I am finding the frame rate to be inconsistent - lots of stuttering followed by a momentary period of higher frame rate, which is not much higher than DX7, and then stuttering again.

The DX7 client has a consistent frame rate, and I think it loads terrain and textures quicker. Also, it sometimes leaves my computer with desktop font anti-aliasing turned off, as if a process hasn't terminated properly.

I am sure these are just temporary problems.

Thanks.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,452
Reaction score
707
Points
203
The frame rate in the 2010 D3D9 client on my computer is usually about four to five times that of inline DX7. Unfortunately, with the 2014 client, I am finding the frame rate to be inconsistent - lots of stuttering followed by a momentary period of higher frame rate, which is not much higher than DX7, and then stuttering again.
I am experiencing this as well.

The DX7 client has a consistent frame rate, and I think it loads terrain and textures quicker. Also, it sometimes leaves my computer with desktop font anti-aliasing turned off, as if a process hasn't terminated properly.
This is not a D3D9Client fault. This is due to an performance optimizing option that was introduced in the 2014 beta. You can turn it off in the Extra tab:

OrbiterBeta_Launchpad_performance.jpg
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
Unfortunately, with the 2014 client, I am finding the frame rate to be inconsistent - lots of stuttering followed by a momentary period of higher frame rate, which is not much higher than DX7, and then stuttering again.

I haven't been able to reproduce that with my current hardware. It sound like it could be caused by frequent creation and deletion of vertex buffers. So, we would need a vertex buffer pool to recycle them. It would be good idea to create necessary amount of buffers into the pool before the simulation starts. Also, it's a good idea to check the texture load frequency from D3D9 Setup panel. Inline engine has 20Hz and I may have increased it to 80Hz which is fine with SSD. I don't know what happens if it's set too high.

I have AMD Radeon HD 7800, are you running with nVidia ?

EDIT: Could you check the load frequency if it has any effect ?
 
Last edited:

SolarLiner

It's necessary, TARS.
Addon Developer
Joined
Jun 14, 2010
Messages
1,847
Reaction score
2
Points
0
Location
404 ROAD NOT FOUND
That's no moon ...
ThatsNoMoon.jpg


It's something that has is rendered below the clouds, but above the surface, and follows me. No matter how close I get to it, it stays the same apparent size. Don't know what this is ...
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,452
Reaction score
707
Points
203
I haven't been able to reproduce that with my current hardware. It sound like it could be caused by frequent creation and deletion of vertex buffers. So, we would need a vertex buffer pool to recycle them. It would be good idea to create necessary amount of buffers into the pool before the simulation starts. Also, it's a good idea to check the texture load frequency from D3D9 Setup panel. Inline engine has 20Hz and I may have increased it to 80Hz which is fine with SSD. I don't know what happens if it's set too high.

I have AMD Radeon HD 7800, are you running with nVidia ?

EDIT: Could you check the load frequency if it has any effect ?
Here's my answers:

Load frequency: No real impact. I tried it with the load frequency set to 20 Hz, 40 Hz and 80 Hz with no real change.

GPU: NVIDIA GeForce GTX 760
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
508
Points
113
That's no moon ...
ThatsNoMoon.jpg


It's something that has is rendered below the clouds, but above the surface, and follows me. No matter how close I get to it, it stays the same apparent size. Don't know what this is ...
It's a know issue (not yet fixed, but on the agenda - among many others ;) )
 

fort

Active member
Joined
Mar 19, 2008
Messages
1,018
Reaction score
20
Points
38
That's no moon ...

I had that too. Can not be in the same conditions but it looks similar. It was in my case the moon for the one I had not installed the basic ( low ) resolution textures.

But looking at your picture, it seems that it must be a different problem.

Edit:
Sorry. The problem for me is with the latest Orbiter version ( 2014 ).
 
Last edited:

Phoenix

New member
Joined
Nov 17, 2009
Messages
72
Reaction score
0
Points
0
DaveS: Thanks, the font anti-aliasing problem is fixed.


Jarmonik: Changing the surface texture load frequency doesn't seem to improve things.

I am using integrated Intel graphics, but I don't think the situation is down to my poor graphics chip because I am getting the same frame rate with DX7 (if I lower the tile resolution bias) as I do with DX9, except I am not getting the frequent stutter with DX7. DX7 currently has better performance, and that can't be right. I don't know what the problem might be.

I have noticed that there are a lot more visualisation parameters for inline DX7 than for the D3D9Client, such as "Tile Resolution Bias". I can get good performance for DX7 by setting this to about halfway below the "zero" level.

Thanks.

---------- Post added at 04:23 PM ---------- Previous post was at 04:15 PM ----------

Like you said, Jarmonik, I think it could be related to tile creation. DX7 appears to be achieving this without causing stutter.
 
Last edited:

jarmonik

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

Here is a new build for Orbiter Beta rev #8.

- Vertex buffer recycling is now implemented, let's see if it effects in performance.

- Atmospheric rendering is now fully on-line. Al thought, the model is still an experimental low level model running with 2.0 shaders. So, what do you like about it and what you don't ?

- People who are running the client with laptops or a low performance hardware could try to investigate the performance impact of the atmospheric rendering by toggling it on and off from the atmospheric control panel. What kind of frame rates do you get with and without the atmosphere ?

- The math that is related to rendering the atmospheric effects is located in Modules/D3D9Client/Surface.fx. I'll try to write some technical documentations for it.

- Delta Glider's main panel is invisible due to reasons unknown.

- Cockpit lights are not yet implemented. Need to cleanup the local lights sources implementation, it is a mesh.
 

Attachments

  • D3D9ClientBeta2-for2014.zip
    1.1 MB · Views: 92

Phoenix

New member
Joined
Nov 17, 2009
Messages
72
Reaction score
0
Points
0
Here is a new build for Orbiter Beta rev #8.

- Vertex buffer recycling is now implemented, let's see if it effects in performance.

- Atmospheric rendering is now fully on-line. Al thought, the model is still an experimental low level model running with 2.0 shaders. So, what do you like about it and what you don't ?

- People who are running the client with laptops or a low performance hardware could try to investigate the performance impact of the atmospheric rendering by toggling it on and off from the atmospheric control panel. What kind of frame rates do you get with and without the atmosphere ?

- The math that is related to rendering the atmospheric effects is located in Modules/D3D9Client/Surface.fx. I'll try to write some technical documentations for it.

- Delta Glider's main panel is invisible due to reasons unknown.

- Cockpit lights are not yet implemented. Need to cleanup the local lights sources implementation, it is a mesh.

I have only had time to take a quick look, but the frame rate is much, much smoother. There is still the occasional stutter, but it's much less than before, and the frame rate is much higher than DX7 on my computer.

The new atmosphere looks fantastic.

Thanks.
 
Last edited:

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 like the atmosphere!

There are two things that I found:
- Under 6km in altitude on Earth, there is a black spot taking almost the entire sky. Above 6km, everything is great.
big_dark_spot.jpg


- It looks you use a vertex shader for the sky, I don't know if a pixel shader can hold the atmo scattering, else you'll have to up the vertex amount, it looks kind of "edgy" now.
edgyAtm.jpg


---------- Post added at 17:34 ---------- Previous post was at 17:17 ----------

Oh, atmospheric scattering is only enabled for the Earth.

And I found the scattering options, messing things up can give quite stunning colors to the atmosphere.
 
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
- Under 6km in altitude on Earth, there is a black spot taking almost the entire sky.

Looks like you may be missing a cloud textures. I am seeing clouds in that region. Haven't had time to fix it yet.

- It looks you use a vertex shader for the sky, I don't know if a pixel shader can hold the atmo scattering, else you'll have to up the vertex amount, it looks kind of "edgy" now.

That is correct. The Mie scattering around the sun can be easily moved to a pixel shader.

Oh, atmospheric scattegin is only enabled for the Earth.

The scattering is working only with a planets having a new surface tile format in use. Currently it's available for the Earth and the Mars. It is likely that we won't support the scattering with the old tile format.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,452
Reaction score
707
Points
203
No issues and performance is great! Well, there's this thing:

It seems to be a problem with how D3D9Client handles the terrain rendering leading to it no being properly rendered in cockpit view. The DG is landed on RWY22L at Edwards AFB.

Inline:
OrbiterBeta_Landed_terrain_inline.jpg


D3D9Client beta 2:
OrbiterBeta_Landed_terrain_D3D9Client.jpg
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
It seems to be a problem with how D3D9Client handles the terrain rendering leading to it no being properly rendered in cockpit view. The DG is landed on RWY22L at Edwards AFB.

Will be fixed in Beta 3
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
Great work, Jarmonik. Getting sunsets to look "right" is really difficult considering the dynamic ranges of night and daytime come together. It's already looking stunning, and the atmosphere controls are very handy.

Some comments...

When looking toward the sun on the horizon, the sunrise looks one way when the camera is above a certain altitude, and then it looks very different when the camera goes below the certain altitude. The difference is pretty big, as the screenshot shows.


I can get the two altitudes to look very similar by setting the Rayleigh color to zero, but then the blue atmosphere seems to wrap around past the terminator too far (probably because I'm abusing the setting). However, I do like a lot of blue at the beginning of an orbital sunrise.


Clouds seem to be a bit dark overall. Clouds are usually at an altitude where a lot of the atmosphere is below them, so they shouldn't be affected very much by the atmospheric shading.

At the terminator, the clouds seem to fade to orange, like the ground. Again, the atmosphere is thinner where clouds usually exist, so the coloring of clouds could be lessened around the terminator.

Here is some quick code idea to show what I'm talking about. In Surface.fx, try

Code:
float4 CloudTechPS(TileVS frg) : COLOR
{
    float4 cTex = tex2D(DiffTexS, frg.tex.xy);

//    return float4(cTex.rgb * frg.atten.rgb + vAddBkg.rgb + frg.insca.rgb, cTex.a);
    return float4(cTex.rgb * max(frg.atten.r, max(frg.atten.g, frg.atten.b)) * 2.0 + vAddBkg.rgb + frg.insca.rgb, cTex.a);
}
Here's a screenshot using the tweak:


The atmosphere also seems too opaque when looking straight down over the terminator.

Is there a way to make clouds visible from the ground that are closer to the horizon?

Also, have cloud shadows been implemented?
 
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
When looking toward the sun on the horizon, the sunrise looks one way when the camera is above a certain altitude, and then it looks very different when the camera goes below the certain altitude. The difference is pretty big, as the screenshot shows.

Thanks, I didn't notice that. There is a jump because it will switch from SkyScatterFast() to HorizonScatterFast() when the camera is considered to be in space.

Try this in HorizonScatterFast(), it should fix the difference.

PHP:
// Optical depth for incoming sunlight	    
float fSun = (fDns+0.05f)*0.5f * AngleCoEff(fDNS);

Clouds seem to be a bit dark overall. Clouds are usually at an altitude where a lot of the atmosphere is below them, so they shouldn't be affected very much by the atmospheric shading.

Yes, I agree. I am still working on it, I was thinking about writing a different shader for cloud layer. Giving more abilities to control the appearance. Clouds can get pretty orange/red when the light is coming from below during sunset.

Here is some quick code idea to show what I'm talking about. In Surface.fx, try

Thanks, I'll take a look.

The atmosphere also seems too opaque when looking straight down over the terminator.
Yes, I have noticed that. Usually covered by dense yellow haze. The haze is probably too bright. Would be nice to find some photos how it looks in a real life.

Is there a way to make clouds visible from the ground that are closer to the horizon?
Yes, Will be fixed in Beta 3

Also, have cloud shadows been implemented?
Not yet.
 

SolarLiner

It's necessary, TARS.
Addon Developer
Joined
Jun 14, 2010
Messages
1,847
Reaction score
2
Points
0
Location
404 ROAD NOT FOUND
The scattering is working only with a planets having a new surface tile format in use. Currently it's available for the Earth and the Mars. It is likely that we won't support the scattering with the old tile format.
Is the scattering related to the terrain? Cannot it be ported to "default" planets with atmospheres? I'd have loved to enter the Venusian atmosphere during a sunrise ...
 

Phoenix

New member
Joined
Nov 17, 2009
Messages
72
Reaction score
0
Points
0
I have had chance to use the beta two client a bit more.

The basic frame rate is much better than beta one on my computer, but despite what I said before, periodic stutter is still a problem on my system, although it might be less so. It seems to be related to the creation of tiles. Even if I use a small window for rendering - 768x576 pixels - I get better frame rate, but the stutter is still there. The DX7 version appears to be able to create tiles without stutter.

I am not an expert, but could it be a CPU thread issue? Maybe the creation of tiles should be on a separate thread to the Orbiter core and D3D9Client. I use an Intel Core Duo processor at 2.1GHz.

Would it be possible to add a "Tile Resolution Bias" control, as exists in DX7? Reducing the vertex count this way would improve basic frame rate for lesser computers, although it still might not fix the stutter.

Thanks.

P.S. When flying straight and level, the frame rate appears stable according to the performance meter, but when rolling - even when pointing in the same direction - that seems to induce stutter. I don't know if that helps.

---------- Post added at 05:26 PM ---------- Previous post was at 05:14 PM ----------

I might have found the fix. Switching the new atmosphere off seems to fix the stutter, and improves basic frame rate. It seems the problem is with my ancient computer.

Thanks.

---------- Post added at 05:32 PM ---------- Previous post was at 05:26 PM ----------

Sorry again, I haven't found the fix. The stutter is still there even when switching the atmosphere off, although the basic frame rate is about 70% better.

Sorry.
 
Last edited:
Top