Cxbx-reloaded: Support Depth != 1 textures

Created on 16 Apr 2018  路  18Comments  路  Source: Cxbx-Reloaded/Cxbx-Reloaded

Volume-textures occur in various titles, like :

TODO : Add more

For this issue:

  • remove the code block that tests for dwDepth != 1, including the LOG_TEST_CASE.
  • test with the above mentioned cases
  • check if volume-textures are working as expected
  • if not, describe what's wrong and/or fix it (most probably a conversion error regarding strides and/or buffer sizes)
  • create a Pull Request
  • relax ;)
HLE enhancement graphics

Most helpful comment

I was thinking of this the other day would it not be possible to implement a fake bump map hack that could introduce bump mapping to games that don't even support it through changing all texture maps to black and white? maybe some engines it could be hacked in eventually for extra effect? Rally sport challeng 2 I remember having very nice and vivid bump mapping for an older game.

All 18 comments

I was thinking of this the other day would it not be possible to implement a fake bump map hack that could introduce bump mapping to games that don't even support it through changing all texture maps to black and white? maybe some engines it could be hacked in eventually for extra effect? Rally sport challeng 2 I remember having very nice and vivid bump mapping for an older game.

@Crimsom13 That idea would be a nice touch for whenever we're twiddling our thumbs ;) You could create a separate issue for that, but it's not related to volume-textures (which is what this issue is about).

@anyone Please report more test-cases to this issue - I have none of the above....

Correct me if I'm wrong but I think you can add Kingdom Under Fire: Heroes to the list.

Indiana jones and the emperors tomb as well (uses the slayer engine that buffy uses)

Add the Halo Demo

grafik

Star Wars Battlefront Demo (from official Xbox Magazine Disc 39) too
swbf1demo

Also BRDF (XDK Sample):
brdf

Good news. More 'target practice' for you. :stuck_out_tongue_winking_eye:
Jurassic Park: Operation Genesis,
Jedi Knight: Jedi Academy (After getting in-game).

Kingdom Under Fire: The Crusaders

Cxbx-Reloaded
---------------------------
Please report that Kingdom Under Fire: The Crusaders shows this test-case: CreateHostResource : Depth != 1
In CreateHostResource (d:\cxbx-reloaded\cxbx-reloaded\src\cxbxkrnl\emud3d8.cpp line 4917)
---------------------------
OK   
---------------------------

Night Caster 2

Cxbx-Reloaded
---------------------------
Please report that NightCaster2 shows this test-case: CreateHostResource : Depth != 1
In CreateHostResource (c:\projects\cxbx-reloaded\src\cxbxkrnl\emud3d8.cpp line 4919)
---------------------------
OK   
---------------------------

Latest result for _Jurassic Park: Operation Genesis_ (See link in my prior comment) says it no longer pops up this message. Maybe put a strike line through the title?

Perhaps it only occurs under specific circumstances - that's not always fully documented. Jurassic Park seems to belong in that category,

I got a question about this, so here some additional information :

Textures can have 1, 2 or 3 dimensions. Textures with 1 dimension just need an X coordinate. Textures with 2 dimensions need an X an Y coordinate. This issue is about textures with 3 dimensions; also called 'volume textures'. They need a third dimension, and that is often called Depth.

This issue is about expanding Cxbx-Reloaded so it can support volume textures with a value for the third (Depth) dimension larger than one.

The tricky part here is we don't know up-front if a title first accesses some depth-layer of a volume texture, or if that's just a normal (2 dimensional) texture.
So we need to establish the origin of the texture, it's base address in memory, the slice pitch to get from one depth-layer to the next, the number of layers, how mipmap levels are arranged within these volumes, etc.

So that's a 5-step procedure for each volume texture. Right?

ok, would it help to have the map file and R_d3d.dll for the pc version of emperors tomb to see how that engine handles them(xbox version also calls it r_d3d in many references on the buffy built slayer engine)???... ...

as an example... the buffy engine has in its map
0001:002933f0 ?Build@CD3DVolumeTexture@@QAE_NPAKJ@Z 00693850 f D3D_Texture.obj
the pc side r_d3d also has
0001:00014550 ?Build@CD3DVolumeTexture@@QAE_NPAKJ@Z 10015550 f D3D_Texture.obj

there are other references of course like ?allocate@, ?refresh@, etc......there is a 0CD3DVolumeTexture function on both...seems to be pretty much similar though

EDIT
Ok digging a little deeper in the maps, the one function that looks like a possibility that ISN'T in the pc side(which has a setdepthmode@cd3d function) is
0002:00007d50 ?Get3DSurfaceDesc@PixelJar@D3D@@YGXPAUD3DPixelContainer@@IPAU_D3DVOLUME_DESC
@@@Z 00988550 f d3d8:pixeljar.obj

thought that might be where it gets the depth portion from. of course could be any of these as well:
0002:000079b0 ?GetSurfaceFormat@PixelJar@D3D@@YGKPAUD3DPixelContainer@@0@Z 009881b0 f d3d8:pixeljar.obj
0002:00007ad0 ?GetDepthBufferScale@PixelJar@D3D@@YGXPAUD3DPixelContainer@@PAM@Z 009882d0 f d3d8:pixeljar.obj
0002:00007b40 ?GetSize@PixelJar@D3D@@YGXPAUD3DPixelContainer@@KPAK1111@Z 00988340 f d3d8:pixeljar.obj
0002:00007c90 ?Get2DSurfaceDesc@PixelJar@D3D@@YGXPAUD3DPixelContainer@@IPAU_D3DSURFACE_DESC@@@Z 00988490 f d3d8:pixeljar.obj

Amped shows this message
image

just updating, at least as of commit 0563734a...buffy now has characters, although the vertex's are wrong/messed up (If I recall that was the issue in indiana jones)..but it is progress
Untitled

Midtown Madness 3, in a test by an user on November 30, 2020, revealed 8 different popup messages, including the one for this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gandalfthewhite19890404 picture gandalfthewhite19890404  路  4Comments

gandalfthewhite19890404 picture gandalfthewhite19890404  路  3Comments

chrisderwahre picture chrisderwahre  路  4Comments

PatrickvL picture PatrickvL  路  3Comments

gandalfthewhite19890404 picture gandalfthewhite19890404  路  3Comments