New Release D3D9Client Development

Frankyman

New member
Joined
Jul 19, 2011
Messages
5
Reaction score
0
Points
0
Hi Guys,

I just tried to install the D3D9client and run into some trouble after running de DXsetup the message I get this time is:

Can't find entrypoint of procedure ?D9AddAABB@@YAXPBUD9BBox@@PBUD3DXMATRIX@@PAU1@_N@Z in DLL-file D3D9TK.dll

Anyone have an idea how to solve this?

Thanks
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Which release did you install? Did you install it over an older release? If so, did you extract and replace all the files from the archive?

The idea to solve it is by installing D3D9TK.dll library containing ?D9AddAABB@@YAXPBUD9BBox@@PBUD3DXMATRIX@@PAU1@_N@Z function.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Are the bump maps used in DX11 Client in A8, L8 or R32 format ?
I suppose I could add an automated cenverter in the client.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Are the bump maps used in DX11 Client in A8, L8 or R32 format ?
I suppose I could add an automated cenverter in the client.
DX11 uses one channel (red one in case there are mupluple channels), then converts height map into normal map using D3DX11ComputeNormalMap function during texture load. Check D3DX library - I'm pretty sure there is such a function even in D3DX9.
Now, there is one more thing about Dan's DGIV - he uses bool GraphicsClient::clbkSetMeshTexture( DEVMESHHANDLE hMesh, DWORD texidx, SURFHANDLE tex ) method to set textures for skins support, so in order for normals to show up you should scan for (and assign) normals maps dynamically when new texture is being assigned.
 

dansteph

Addon Developer
Addon Developer
Beta Tester
Joined
Apr 30, 2008
Messages
788
Reaction score
64
Points
28
Website
orbiter.dansteph.com
Now, there is one more thing about Dan's DGIV - he uses bool GraphicsClient::clbkSetMeshTexture( DEVMESHHANDLE hMesh, DWORD texidx, SURFHANDLE tex ) method to set textures for skins support, so in order for normals to show up you should scan for (and assign) normals maps dynamically when new texture is being assigned.

I just checked with the Arrow Freighter which use the same skin method and
it work as expected: normal map being loaded in same time than diffuse skin.

I didn't succeed much with normal map as bump map however, the result is ugly.
Either my photoshop plugin or my understanding of normal map. (128 grey for "neutral" bump,
converted to normal map using the photoshop plugin: exported in VU8)

------

About implementation I think engines must establish a standard so the render
look somewhat the same in both engine. That would enforce the use of
engine's special features for developers while different rendering would make
them useless. (Addons maker would be forced to release specifics versions
which is hard to do and maintain and a headache also for users and download pages)
 
Last edited:

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Now, there is one more thing about Dan's DGIV - he uses bool GraphicsClient::clbkSetMeshTexture( DEVMESHHANDLE hMesh, DWORD texidx, SURFHANDLE tex ) method to set textures for skins support
Normal (and other) maps are tried to be loaded with a call to GraphicsClient::clbkLoadTexture and they are stored in the D3D9Surface class, so every separate texture loaded this way can have a separate normal (or other) map. GraphicsClient::clbkSetMeshTexture changes the referenced texture maps by changing referenced D3D9Surface, and texture maps are fetched from the D3D9Surface class when the (external) mesh is rendered, so no worries, they will be all updated just fine to new after the clbkSetMeshTexture was called.
 

dansteph

Addon Developer
Addon Developer
Beta Tester
Joined
Apr 30, 2008
Messages
788
Reaction score
64
Points
28
Website
orbiter.dansteph.com
There's _norm instead, and _bump should be easily convertible to _norm.

Well, from my quick test it seem you need to export the normal map from model
and it's not easy to simply paint bump over it. Bump map in contrary are very easy
to do: just paint with whatever graphic editor and you have small details added
with full control and no need for 3d model.

Maybe I'm wrong on my use of normal map but if not, its easier for anyone even
third party painter to make bump map. So it would be cool in Dx9 also.
 
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Bump Map Support

Here is a new build with bump map support. BumpMap amplitude factor can be changed from D3D9Client.cfg. I don't have any real bump maps to test it, really but it seems to be working.
 

Attachments

  • D3D9ClientR7b.zip
    286.8 KB · Views: 47

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Hi Jarmo et al,

is it correct that "bump"- and "normal"-map are used to render the same result (serve the same feature)?

If yes and "bump"-map is much easier[1] and also supported by D3D11Client, I vote for "bump"-maps and the "norm"-maps feature should be completely removed!
If however the "norm"-maps provides something that "bump"-maps can't provide, the feature should be available in both Clients (*9 and *11).

/Kuddel

[1] as posted by dansteph
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Hi Jarmo et al,

is it correct that "bump"- and "normal"-map are used to render the same result (serve the same feature)?

If yes and "bump"-map is much easier[1] and also supported by D3D11Client, I vote for "bump"-maps and the "norm"-maps feature should be completely removed!
If however the "norm"-maps provides something that "bump"-maps can't provide, the feature should be available in both Clients (*9 and *11).

/Kuddel

[1] as posted by dansteph
It's easy enough both ways as bump map is essentially a heightmap. And having a heightmap is preferred compared to normal map, because you can always compute normal map from heightmap, but not the other way around.
Also heightmaps allow for some advanced features like vessel tesselation, while normal maps doesn't have height info and there is no way to calculate it.

So with all being equal it's preferred to have a height(bump) map.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
I vote for "bump"-maps and the "norm"-maps feature should be completely removed!
I vote against normal maps being removed. Bump maps are converted to normal maps anyway before they are used. Support for them in _norm files should stay in D3D9Client and if it's missing in D3D11Client, then it should be added there too.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
I vote against normal maps being removed. Bump maps are converted to normal maps anyway before they are used. Support for them in _norm files should stay in D3D9Client and if it's missing in D3D11Client, then it should be added there too.
DX11 supports normal maps and I'm against removing that support. But as I've said before, between bump map and normal map I'd pick a former one because it conveys more information that normal map does, and any additional information can be useful.
 

dansteph

Addon Developer
Addon Developer
Beta Tester
Joined
Apr 30, 2008
Messages
788
Reaction score
64
Points
28
Website
orbiter.dansteph.com
Here is a new build with bump map support. BumpMap amplitude factor can be changed from D3D9Client.cfg. I don't have any real bump maps to test it, really but it seems to be working.

Great Add ! :cheers:

Here's the result (gray diffuse, only bump in 8:8:8)

ArrowBump20121112165022.jpg


Now I can take a stock DG's scenery and provide a diffuse and bump so we can see if it look the same in both engine ? (I have XP so no DX11)

I vote against normal maps being removed.

I don't see also any reason to remove such feature. I think the proposal was because kuddel thought we could not have both.

But we can so, no reasons at all.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Hi all,

thanks for all the information. Having both available is O.K.
I just thought it might confuse developers, not knowing if they have to add both or only one of them...

What does the D3D11Client (D3D9Client as well) do when both formats are provided? Is there any preference?
a) foo_norm.dds is taken, foo_bump.dds is ignored
b) foo_bump.dds is taken, foo_norm.dds is ignored
c) ??? (somthing Kuddel has not thought of :hmm: )

I am asking because I want to make the documentation as clear as possible.

Thanks in advance,
Kuddel
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Hi all,

thanks for all the information. Having both available is O.K.
I just thought it might confuse developers, not knowing if they have to add both or only one of them...

What does the D3D11Client (D3D9Client as well) do when both formats are provided? Is there any preference?
a) foo_norm.dds is taken, foo_bump.dds is ignored
b) foo_bump.dds is taken, foo_norm.dds is ignored
c) ??? (somthing Kuddel has not thought of :hmm: )

I am asking because I want to make the documentation as clear as possible.

Thanks in advance,
Kuddel
In DX11 bump map is taking precedence.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Currently D3D9Client is set to prefer a normal map over a bump map. But I can reverse it, since, it really doesn't matter much.

I do prefer a normal map over a bump map since it gives more control and better precission over a pixel. Bump maps are old and usually replaced by normal maps, however, due to arrival of displacement mapping techniques some people have started to give move value for bump maps, since, it can be used as a displacement map. However, a modern graphics engines are using normal maps and displacement maps at the same time.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Currently D3D9Client is set to prefer a normal map over a bump map. But I can reverse it, since, it really doesn't matter much.

I do prefer a normal map over a bump map since it gives more control and better precission over a pixel. Bump maps are old and usually replaced by normal maps, however, due to arrival of displacement mapping techniques some people have started to give move value for bump maps, since, it can be used as a displacement map. However, a modern graphics engines are using normal maps and displacement maps at the same time.

That's precisely why I prefer bumpmaps over normal maps any minute! There are plans to add displacement mapping and tesselation for vessels (and, possibly, for other objects like base meshes) - and this technique requires heightmap, normal map is not enough.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Currently D3D9Client is set to prefer a normal map over a bump map. But I can reverse it, since, it really doesn't matter much.
It would only matter when somebody released add-on with both bump and normal maps for the same texture, but why would they do that (I think it would be rather released with separate normal + optionally displacement or just the bump map)?
 
Top