Welcome, Guest.
Username: Password: Remember me

TOPIC: [SOLVED] Direct3D 8 error

Direct3D 8 error 1 year 8 months ago #1

  • rolfba
  • rolfba's Avatar
  • Offline
  • Posts: 10
  • Thank you received: 1
Im trying to apply SweetFX to a pretty old game.

"Earth and Beyond", and since its a d3d8 game i installed reshade as such.

Its working until the game is force closed and the d3d8.log file contains the line:

"Failed to translate 'IDirect3DDevice8::CreateImageSurface' call for '[128, 128, 20]'!"

/Rolf
The administrator has disabled public write access.

Direct3D 8 error 1 year 8 months ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2446
  • Thank you received: 1388
There should be more errors, please check if something related to vertex/pixel shader translation fails =).
Cheers, crosire =)
The administrator has disabled public write access.

Direct3D 8 error 1 year 8 months ago #3

  • rolfba
  • rolfba's Avatar
  • Offline
  • Posts: 10
  • Thank you received: 1
Im affraid its the only error i can see in the log:

pastebin.com/nParUVia

/Rolf
The administrator has disabled public write access.

Direct3D 8 error 1 year 8 months ago #4

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2446
  • Thank you received: 1388
That's interesting, so it's indeed that texture creation failure that forces the game to close. It tries to create a texture of format "D3DFMT_R8G8B8", which explains why it doesn't work, there is little D3D9+ hardware supporting that format, I'm guessing it works under default D3D8 because the game then might runs on software emulation instead of on the GPU.
I can force replace that format with something working, but that would probably mess up the image saved in that texture ...
Cheers, crosire =)
Last Edit: 1 year 8 months ago by crosire.
The administrator has disabled public write access.

Direct3D 8 error 1 year 8 months ago #5

  • rolfba
  • rolfba's Avatar
  • Offline
  • Posts: 10
  • Thank you received: 1
It might work to switch it out with D3DFMT_X8R8G8B8 instead, i dont think they use many shaders that would be to confused by this.

I mean, its not working as it is now, so might as well try to fix it, if it messes the texture up, ill report back any errors i see.

/Rolf
Last Edit: 1 year 8 months ago by rolfba.
The administrator has disabled public write access.

Direct3D 8 error 1 year 8 months ago #6

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2446
  • Thank you received: 1388
That's what I would have done. Problem is not the shaders, they don't see a difference between the two, problem is loading the image from memory into the texture. D3DFMT_X8R8G8B8 expects image data aligned to 32bpp (bits per pixel), whereas D3DFMT_R8G8B8 expects 24bpp data.
Those are not compatible (obviously) and it thus would look wrong or worse actually, it would simply crash, because the game provides far less data than D3D8 tries to read from memory:
  • 100px * 100px * 24bpp = 240kB < This is what the game provides in case of a 100x100 texture
  • 100px * 100px * 32bpp = 320kB < This is what D3D8 expects
I'm not saying it's impossible, since ReShade can modify the data send to D3D8 (or D3D9 actually). It's just a little complicated.
Cheers, crosire =)
Last Edit: 1 year 8 months ago by crosire.
The administrator has disabled public write access.

Direct3D 8 error 1 year 8 months ago #7

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2446
  • Thank you received: 1388
So tried a game which had similar issues because of missing D3DFMT_R8G8B8 and replacing it with D3DFMT_X8R8G8B8 without much further doing works surprisingly well, the affected textures were correct. Looks like even D3DFMT_R8G8B8 took 32bpp data?
Anyway, fixed in 0.16.0 now. =)
Cheers, crosire =)
The administrator has disabled public write access.

Direct3D 8 error 1 year 8 months ago #8

  • rolfba
  • rolfba's Avatar
  • Offline
  • Posts: 10
  • Thank you received: 1
Great, i cant wait to test it out in my old game Earth and Beyond, i think it will be very cool to get some SweetFX going on that one :D

Thanks alot for adding this in.
The administrator has disabled public write access.