Jump to content


Photo

TDM portal culling improved


  • Please log in to reply
23 replies to this topic

#1 anonreclaimer

anonreclaimer

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 23 November 2016 - 01:56 AM

*
POPULAR

Hello people I have back ported the render matrix code from Doom 3 BFG to TDM to improve the portal code and I have also added depth testing for lights. The depth testing for lights cvar is r_useDepthBoundsTest I didn't really want to add a new cvar. There's also a experimental anti portal code in CullEntityByPortals to activate set r_useEntityPortalCulling to 2 but transparent surfaces are broken. The render matrix code used for portals can use C++ generic and intrinsics but intrinsics is enable by default. My TDM source was compiled in vs2015 using the vs2010 platform toolset all of my code changes can be found by searching for the "anon" comment. I hope this code can be beneficial and useful to the TDM developers.

 

NEW Cvar

r_useEntityPortalCulling 

r_useLightPortalCulling 

r_useLightAreaCulling

 

Binary here -> https://drive.google...iew?usp=sharing

Source Here -> https://drive.google...iew?usp=sharing  (.rar file)

 

 

 

 


  • Bikerdude, AluminumHaste, HMart and 6 others like this

#2 duzenko

duzenko

    Member

  • Mission Beta Tester
  • PipPip
  • 201 posts

Posted 23 November 2016 - 02:12 AM

Thanks a lot.
Do you think you would be able to do the same with the threading model? (game tic + front renderer run on a thread in BFG)
...
Your exe crashes at startup for me. (darkmod.exe has stopped working...)
...
You release seem to be based on 2.04 version. Is it possible to apply this change to current trunk?



#3 duzenko

duzenko

    Member

  • Mission Beta Tester
  • PipPip
  • 201 posts

Posted 23 November 2016 - 09:33 AM

Merged changes into svn rev 6685.

Controlling cvar - r_useAnonreclaimer.

Quick test: skybox not rendered.

...

vid_restarts fixed the skybox but fps appears to be the same using the old and new code.



#4 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7288 posts

Posted 23 November 2016 - 10:28 AM

Try Rightful Property, Penny Dreadful 3, or another mission with wide open areas. Biker has done too good of a job optimizing our missions with expert portal placement so it may be hard to find ones that benefit.
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#5 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 23 November 2016 - 10:59 AM

WHOA!

 

That is a massive code change to do two days before code freeze.

 

It will require a lot of testing, and I'd rather do that in 2.06 than in the few weeks remaining before we release 2.05.


  • HMart, Goldwell and Anderson like this

#6 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7288 posts

Posted 23 November 2016 - 11:21 AM

I was thinking the same but its hidden by a cvar so the risk should be minimized. Your call :)
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#7 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 23 November 2016 - 11:40 AM

So there's a cvar wrapper around every code line that was changed?


  • Anderson likes this

#8 duzenko

duzenko

    Member

  • Mission Beta Tester
  • PipPip
  • 201 posts

Posted 23 November 2016 - 11:49 AM

Eww
I thought code freeze means don't change after day X, not before :D

No, really. It's all under a cvar. Nothing changes by default.

(I think ;) )



#9 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 23 November 2016 - 11:58 AM

Yes, code freeze means get your tested stuff in before that date.

 

But, this just happened this morning, and it's a lot of code that might be full of lots of splinters.

 

Had it been introduced a month ago and discussed by everyone and tested by the performance folks and really wrung out, it would have been fine wrapping up a couple days before the freeze and including in the release.

 

But not like this; the runway is too short.


  • Anderson likes this

#10 duzenko

duzenko

    Member

  • Mission Beta Tester
  • PipPip
  • 201 posts

Posted 23 November 2016 - 12:10 PM

The code comes from d3 bfg, which we should strive to adopt anyway IMHO



#11 New Horizon

New Horizon

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 13660 posts

Posted 23 November 2016 - 12:16 PM

Even though it's too late to test it properly before 2.05, that is one awesome update to see come through for 2.06. :)  Nice.  Hope we can have more improvements like that come through.



#12 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 23 November 2016 - 01:00 PM

What does it do, in laymen's terms?


  • Springheel likes this

#13 New Horizon

New Horizon

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 13660 posts

Posted 23 November 2016 - 01:10 PM

My understanding is that there should be some performance enhancement due to better handling of portals and lights but that's my limited understanding of how the engine works.  



#14 duzenko

duzenko

    Member

  • Mission Beta Tester
  • PipPip
  • 201 posts

Posted 23 November 2016 - 01:31 PM

It is supposed to do the culling like bfg does, using a certain "rendering matrix".

I tried down by riverside, pd3, rightful property and can't see any fps gain.

Spoiler



#15 anonreclaimer

anonreclaimer

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 23 November 2016 - 01:31 PM

Well it nothing more then a math matrix code being used to help to cull entity's and light's. I replaced the old crappy culling code with render matrix for better performance but it wasn't too much. This is just a math matrix code that use C++ generic and Intrinsics if enabled can speed up math calculations being applied to the portal culling system so it's suppose to be a bit faster, with this in mind I believe you guys can use this to further improve the culling system.


  • Anderson likes this

#16 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 23 November 2016 - 01:39 PM

Okay, let me reword my question ...

 

If we write up a blurb for a release, what would the blurb say that a player would understand? (I.e. this improves performance in large open areas on older systems.)

 

Players don't give a hoot if all we say is we refactored something.



#17 duzenko

duzenko

    Member

  • Mission Beta Tester
  • PipPip
  • 201 posts

Posted 23 November 2016 - 01:43 PM

Personally I don't see any immediate benefit but it could save time in the future when/if we want to borrow more stuff from bfg.



#18 Goldwell

Goldwell

    Team Member

  • Active Developer
  • PipPipPipPip
  • 2024 posts

Posted 23 November 2016 - 07:31 PM

in the few weeks remaining before we release 2.05.

 

Oh nice! I didn't know it was so close, 2.05 includes a whole heap of assets for us mappers as well right?


The Accountant Series
Part 1: A Noble Home (complete rebuild coming soon) | Part 2: New In town


Lord Edgar Trilogy
Lord Edgar's Bathhouse | Lord Edgar's Disappearance | Lord Edgar's Estate
 
Stand Alone Missions
Spring Cleaning

#19 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7288 posts

Posted 23 November 2016 - 07:35 PM

Yes. A big asset release.
  • Goldwell and Anderson like this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#20 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 23 November 2016 - 08:25 PM

*
POPULAR

As our new president might say, "this will be the biggest heap of assets you've ever seen, and I only use the best assets, and these are the best assets!!"


  • HMart, nbohr1more, Epifire and 2 others like this

#21 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 35803 posts

Posted 23 November 2016 - 08:55 PM

*
POPULAR

I created well over two hundred architectural models over the last year that will all be released with this update.  Not to mention a slew of other things I made along the way--new lights, decorative props, scattered junk, etc.

Attached Files


  • New Horizon, Bikerdude, AluminumHaste and 4 others like this
Posted Image

#22 AluminumHaste

AluminumHaste

    Darkmod Contributor

  • Development Role
  • PipPipPipPipPip
  • 5544 posts

Posted 23 November 2016 - 10:47 PM

Thank you for the hard work, I'm sure we'll find a use for it!

Were you planning on any other contributions good sir?

 

A huge one would be GPU Skinning from BFG.

 

Huh, apparently Doom 3 BFG code contains an HLSL to GLSL converter (ConvertCG2GLSL)

Might be worth looking at also.


  • Anderson likes this

I always assumed I'd taste like boot leather.

 

#23 duzenko

duzenko

    Member

  • Mission Beta Tester
  • PipPip
  • 201 posts

Posted 24 November 2016 - 04:49 AM

Whatever you do, just please try to do it with the latest source code in svn.

It's a pain to merge changes to an old release.


  • Anderson likes this

#24 Anderson

Anderson

    Advanced Member

  • Member
  • PipPipPip
  • 577 posts

Posted 25 November 2016 - 11:00 AM

WHOA!

 

That is a massive code change to do two days before code freeze.

 

It will require a lot of testing, and I'd rather do that in 2.06 than in the few weeks remaining before we release 2.05.

By the way, is the time constraint the reason for postponing EAX until 2.06? My conclusion is drawn from and according to the bugtracker.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users