[SOLVED] Direct3D 8 error

  • rolfba
  • Topic Author
More
9 years 1 month ago #1 by rolfba Direct3D 8 error was created 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.

  • crosire
More
9 years 1 month ago #2 by crosire Replied by crosire on topic Direct3D 8 error
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.

  • rolfba
  • Topic Author
More
9 years 1 month ago #3 by rolfba Replied by rolfba on topic Direct3D 8 error
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.

  • crosire
More
9 years 1 month ago - 9 years 1 month ago #4 by crosire Replied by crosire on topic Direct3D 8 error
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 ...
Last edit: 9 years 1 month ago by crosire.

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

  • rolfba
  • Topic Author
More
9 years 1 month ago - 9 years 1 month ago #5 by rolfba Replied by rolfba on topic Direct3D 8 error
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: 9 years 1 month ago by rolfba.

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

  • crosire
More
9 years 1 month ago - 9 years 1 month ago #6 by crosire Replied by crosire on topic Direct3D 8 error
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.
Last edit: 9 years 1 month ago by crosire.

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

  • crosire
More
9 years 1 month ago #7 by crosire Replied by crosire on topic Direct3D 8 error
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.

  • rolfba
  • Topic Author
More
9 years 1 month ago #8 by rolfba Replied by rolfba on topic Direct3D 8 error
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.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.