VOGONS


Bloodrayne 2 (with FSAA Patch)

Topic actions

First post, by choin

User metadata
Rank Newbie
Rank
Newbie

There is a mod called "Bloodrayne 2 FSAA Patch 1.666" that provides certain benefits to the game. It works through its own d3d8.dll but also involves br2Cuda.dll and cudart32_32_16.dll (not sure how that combination even works). I'd like to convert it to dgVoodoo's d3d9/d3d11 in order to apply more enhancements.

I've tried renaming the mod's d3d8 and the reference of it in game executable - it works like usual, but it fails to consider dgVoodoo's d3d8.dll. ProcMon shows that it doesn't even try that - it loads d3d8thk.dll straightaway.

Is there a way to use dgVoodoo together with this mod? Or in other situations where custom versions of d3d8.dll are used?

Reply 1 of 20, by Dege

User metadata
Rank l33t
Rank
l33t

The mod d3d8 may always load the d3d8.dll from the system folder.
Try renaming dgVoodoo d3d8.dll to, say, dgd8.dll and change 'd3d8' substrings to 'dgd8' in the mod d3d8.dll

So, the chain would look like this: Rayne2.exe --> d3d8.dll (mod) --> dgd8.dll (dgVoodoo).

Reply 2 of 20, by choin

User metadata
Rank Newbie
Rank
Newbie

Thank you for suggestion. It worked. Even though for it to work I also had to modify the code of the d3d8.dll (mod) in order to stop it from adding System32 path to the dgd8.dll loading.

Anyway, I've decided against using dgVoodoo in this case because I've found a project that fixes issues with the original mod on Windows 8.1/10 (including stutter issue) and also includes d3d8to9, which is really enough for me to apply the enhancements I wanted. In case anyone needs, it's here https://github.com/elishacloud/BloodRayne-2-Patch

Reply 3 of 20, by choin

User metadata
Rank Newbie
Rank
Newbie

Actually, scratch that. I'd like to try dgVoodoo since there is an issue with lighting when d3d8to9 is used. Problem: it appears the mod can work just fine alone or with d3d8to9, but when combined with dgVoodoo the fps goes unstable and low. Any chance to debug this? I can provide all the patched files to make it work.

Reply 5 of 20, by choin

User metadata
Rank Newbie
Rank
Newbie

Here. Unpack, add your resolution in system\rayne.ini and enable all gfx options in the launch window.
However I found that fps problem only happens if "optimize vertex buffers" mod setting is enabled. Some other issues I saw for now, compared to d3d8to9:
- I can't force SSAA through the driver with dgVoodoo, but it seems to work if I just set the AA mode to SSAA and choose MSAA mode in either dgVoodoo or mod settings.
- When dgVoodoo's MSAA is active, there is a lighted region on the left side of the screen.
- Dynamic shadow got black edges around its square transparent texture once. Can't replicate anymore though.
- Saw glitchy shadows around distant structures. Can't replicate this anymore either.
- From time to time, like once in 30 sec to 2 min, a full frame looks completely black. Not annoying but seems like a bug.

Attachments

  • Filename
    BloodRayne2dgvoodoo.zip
    File size
    3.35 MiB
    Downloads
    70 downloads
    File license
    Fair use/fair dealing exception
Last edited by choin on 2019-11-10, 15:53. Edited 1 time in total.

Reply 7 of 20, by Dege

User metadata
Rank l33t
Rank
l33t

As I guessed, there are some bad driving parts in the mod dll.

dgVoodoo debug layer throws warnings about the usage of vertex and index buffers.

[dgVoodoo] WARNING: Direct3DIndexBuffer8 (0F7CF8F0)::Lock: Invalid parameters: D3DLOCK_READONLY flag cannot be used together with D3DLOCK_DISCARD or D3DUSAGE_WRITEONLY

It's not really a problem, but when 'Optimize Vertex Buffers' is enabled then this one additionally comes:

[dgVoodoo] WARNING: Direct3DVertexBuffer8 (16039D50)::Lock: Invalid parameters: D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE is specified but buffer type is not dynamic.

Non-dynamic buffer locked with discard or nooverwrite usage, with high frequency. It can be solved but doesn't maps well to D3D11 that's why massive FPS drop occurs.

I quickly tried an optimization for that case, and while it works, I'm not sure I'll include that in the next incremental version, because I don't feel it a sterling solution.
It could be easily fixed in the mod dll itself, but that's not an option I guess, so just let's keep 'Optimize Vertex Buffers' disabled, the game runs just fine with that.

choin wrote:

- I can't force SSAA through the driver with dgVoodoo, but it seems to work if I just set the AA mode to SSAA and choose MSAA mode in either dgVoodoo or mod settings.

Through the display driver control panel?

choin wrote:

- When dgVoodoo's MSAA is active, there is a lighted region on the left side of the screen.

I tried the widescreen support and while it works, in the sense of using the proper projection matrix to avoid image stretching, the game still calculates the visibility of some(?) objects assuming a 4:3 viewport, so some objects disappears-reappears on the sides of the screen as if the rendering itself were erroneous. Doesn't that lighted region come from such a partially rendered region?

choin wrote:

- From time to time, like once in 30 sec to 2 min, a full frame looks completely black. Not annoying but seems like a bug.

I played the game for a while but couldn't reproduce this. Is there a specific location (level) for that in the game maybe?

Reply 8 of 20, by choin

User metadata
Rank Newbie
Rank
Newbie

Yes from the display driver panel. I mean it works with DX8to9 and original DX8. My guess is that dg does something differently, or it's how driver works differently for DX11, if dg uses it.

The disappearing stuff is from the mod's broken widescreen support. The included main exe comes with a fix for that but mod's resolution and aspect controls must be disabled - enter your resolution in rayne ini file.
This has nothing to do with what I've described - it looks just like a tint or a broken light shader, which can also go away for some time if menu is opened with Esc. Also it's not there if MSAA is disabled.
I'll try to provide a screenshot later.

Will also watch for the black frame and report back.

Reply 9 of 20, by choin

User metadata
Rank Newbie
Rank
Newbie

Here, note the left side of the display, https://i.imgur.com/40DdVdh.jpg
Without MSAA https://i.imgur.com/8QZCQJE.jpg
Looks like the same thing happens at the top side too.

The black frame still happens, but I was wrong about intervals. I don't know what causes it. But at the very first level, it happens at least once during the first 5 minutes. I think it doesn't happen when standing still.

Reply 10 of 20, by Dege

User metadata
Rank l33t
Rank
l33t

Ah, now I see what you meant, thanks.
Well, unfortunately that's a glitch coming from the fact that only half of a pixel is rendered at the top and the bottom because of the presence of MSAA subpixels, instead of a single pixel-center of the non-MSAA case. The texture rendered with that one-pixel glitch is then scaled over the screen in the rendering technique the game uses, so, that's why a thick strip appears in the end. 🙁

As for the black frames, I'll give a go for the first 2 levels and will see it. 😀

Reply 12 of 20, by choin

User metadata
Rank Newbie
Rank
Newbie

I've tried setting DeframerSize=16 and it didn't change anything.

Maybe there would be no such issue if MSAA or SSAA could be forced through the driver, but with dgVoodoo it just doesn't work. With original DX8 and DX8to9 it works.

Also I'm not sure if it was my mistake before, but this part is not completely true:

it seems to work if I just set the AA mode to SSAA and choose MSAA mode in either dgVoodoo or mod settings.

Right now from what I see, the only way for me to get AA working and not have that glitch with dgVoodoo is to choose AA mode in the driver and set AA samples in mod settings. Then MSAA in dgVoodoo should be set to App driven, any other option makes the game crash on launch.

Reply 13 of 20, by Dege

User metadata
Rank l33t
Rank
l33t
choin wrote:

Maybe there would be no such issue if MSAA or SSAA could be forced through the driver, but with dgVoodoo it just doesn't work. With original DX8 and DX8to9 it works.

I'm not an expert on driver control panels, but, isn't it that you should define a D3D11 profile for the game, instead of the default D3D8/9 to get it to work? AFAIR once I read this or sg similar on another forum.

choin wrote:

Right now from what I see, the only way for me to get AA working and not have that glitch with dgVoodoo is to choose AA mode in the driver and set AA samples in mod settings. Then MSAA in dgVoodoo should be set to App driven, any other option makes the game crash on launch.

That's the expected way. Forced resolution or MSAA can easily bring in various type of glitches, so they aren't "guaranteed" features. If the game itself provides an option to MSAA then always use that.
+
If you select true MSAA in the game options and dgVoodoo is configured for a forced MSAA, then the game will probably crash because dgVoodoo exposes no MSAA capabilities to the game, while it wants to create MSAA'ed textures/surfaces.

Reply 14 of 20, by choin

User metadata
Rank Newbie
Rank
Newbie

Thanks for info.

I suppose you are right, expecting the driver AA override to work same between DX9 and DX11 is not exactly logical. Although I don't see DX11-specific options regarding that in my panel. But since there is still a way to force it with the help of mod settings, it's not much of a concern.

Reply 18 of 20, by Dege

User metadata
Rank l33t
Rank
l33t

Yes, I used your .zip pack. I thought you enabled a special effect in addition to that, that's why I asked for it.
Well, I only changed the resolution in rayne2.ini and played through the first level that way and encountered no problems.

I suppose you're using the latest version of dgVoodoo (the config file in your pack is versioned as 2.55, with only 128MB video memory which can be insufficient).
You might want to try the game with the spec-release version of dgVoodoo to see if dgVoodoo dumps error(s) when playing.