ataulien / GD3D11

D3D11-Renderer for Gothic and Gothic 2
GNU General Public License v3.0
175 stars 76 forks source link

Turn off a new PFX render #60

Closed postm1 closed 5 years ago

postm1 commented 6 years ago

How can I turn off DX11 PFX render and use gothic's engine one? There are many flaws in DX11 pfx renderer. I mean only PFX, is it easy to drop in the code?

Katharsas commented 6 years ago

How would you want to use gothic's engine code? There is no source code for it. If you want to re-implement it go ahead. But fixing flaws would probably be easier.

postm1 commented 6 years ago

I mean, Does dx11 hook PFX functions of gothic engine so it can be easily turned off, or dx11 renders it in one common function?

Using word "PFX" I mean visual of spells. (zCParticleFX)

Katharsas commented 6 years ago

See: void GothicAPI::DrawParticlesSimple() at https://github.com/ataulien/GD3D11/blob/master/D3D11Engine/GothicAPI.cpp#L851 This (i think) renders zCParticleFX if it is inside ParticleEffectVobs list and near camera.

In the same file you can find void GothicAPI::OnAddVob(zCVob * vob, zCWorld * world) and void GothicAPI::OnRemovedVob(zCVob * vob, zCWorld * world) which add and remove particles to/from ParticleEffectVobs.

Here is class for interaction with particle data through hooks: https://github.com/ataulien/GD3D11/blob/master/D3D11Engine/zCParticleFX.h It seems like calling its destructor also leads to removal of pfx from ParticleEffectVobs.

So yes, if you make void GothicAPI::DrawParticlesSimple() (or some render function it calls) not do anything it won't render. But then pfx will not render at all.

postm1 commented 6 years ago

Thanks, I will try.