[SOLVED] Direct3D 8 error

  • Posts: 10
5 years 3 months ago #1 by rolfba
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

Please Log in or Create an account to join the conversation.

  • Posts: 3740
5 years 3 months ago #2 by crosire
There should be more errors, please check if something related to vertex/pixel shader translation fails =).

Please Log in or Create an account to join the conversation.

  • Posts: 10
5 years 3 months ago #3 by rolfba
Im affraid its the only error i can see in the log:

pastebin.com/nParUVia

/Rolf

Please Log in or Create an account to join the conversation.

  • Posts: 3740
5 years 3 months ago - 5 years 3 months ago #4 by crosire
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 ...

Please Log in or Create an account to join the conversation.

  • Posts: 10
5 years 3 months ago - 5 years 3 months ago #5 by rolfba
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

Please Log in or Create an account to join the conversation.

  • Posts: 3740
5 years 3 months ago - 5 years 3 months ago #6 by crosire
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.

Please Log in or Create an account to join the conversation.

  • Posts: 3740
5 years 3 months ago #7 by crosire
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. =)

Please Log in or Create an account to join the conversation.

  • Posts: 10
5 years 3 months ago #8 by rolfba
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.

Please Log in or Create an account to join the conversation.