Jump to content
The Dark Mod Forums
Sign in to follow this  
duzenko

[2.08] New performance tuning ideas

Recommended Posts

I am considering the following tuning tool ideas

  • limit tri per surface
  • "real" skip bump/specular/diffuse textures (bump is already there for interactions AFAIR)
  • draw surfaces with color depending on its tri count
  • draw surfaces with color depending on its material stage count
  • toggle decals
  • skip lights further than X units away
  • skip entities further than X units away
  • skip shadows further than X units away
  • skip lights further than X units away

If there's something you felt could make a great addition please post here

  • Like 2

Share this post


Link to post
Share on other sites

Wish I could help here my friend, but Im pretty ignorant about the issue. I remember I found this read to be interesting, but its probably old news to you anyway - https://www.google.com/url?sa=t&source=web&rct=j&url=http://fabiensanglard.net/doom3_documentation/DOOM-3-BFG-Technical-Note.pdf&ved=2ahUKEwjf1O_UmergAhXbHbkGHZsNBX04ChAWMAR6BAgCEAE&usg=AOvVaw0X7cH7bMI1n9eeqjgR9NaP

 

I do like the sound of all the features you suggested, though I wonder if skipping lights and shadows might result in a 'popping' effect once they come into existance inside the players pov? But maybe they wouldnt in your implementation.

 

I would love a sort of true lod mechanics that reduces tris for any geometry, not only selected entities that you have to setup in advance. But I might be dreaming here, no idea if its feasible.

 

Another thing that could be interesting to consider is the AI thinking, the pipeline there, that can have quite an impact on the maps performance...

  • Like 1

Share this post


Link to post
Share on other sites

Is it only for mappers to investigate performance issues on their WIP maps?

The ideas don't sound like something you could offer to a player.

  • Like 2

Share this post


Link to post
Share on other sites

Skipping lights / shadows / entities etc. is already viable with LOD system, and IMO it's mappers who should determine such things, as it depends on dimensions and shape of their map. IMO tools like SEED or func_portal are really underutilized, so maybe a good video tutorial for mappers will do?

 

Speaking of LOD, I'd really love to see some automatic or semi-automatic effect for LOD fade-in, as the current implementation doesn't work at all (I checked). Something that's easily controllable through one value, that would work with both func_portals, shadows, models etc.

Edited by Judith

Share this post


Link to post
Share on other sites

I am considering the following tuning tool ideas

  • limit tri per surface
  • - Is dynamic based on distance?
  • "real" skip bump/specular/diffuse textures (bump is already there for interactions AFAIR)
  • - What does this mean? Don't we already have that option? I see console commands that say skipbump, skipspecular, etc. will that be different?
  • draw surfaces with color depending on its tri count
  • - The only time I see this being useful is to test if some third party object has to much tris and you can't see it with the regular r_showTris cmd.
  • toggle decals
  • - How is this different from r_skipOverlays?
  • skip lights further than X units away
  • - Very useful especially for outdoor environments.
  • skip entities further than X units away
  • - Very useful especially for outdoor environments.
  • skip shadows further than X units away
  • - Very useful especially for outdoor environments.
  • skip lights further than X units away
  • - see above... :P

If there's something you felt could make a great addition please post here

Share this post


Link to post
Share on other sites

Speaking of LOD, I'd really love to see some automatic or semi-automatic effect for LOD fade-in, as the current implementation doesn't work at all (I checked). Something that's easily controllable through one value, that would work with both func_portals, shadows, models etc.

 

Yes, fading, as opposed to popping, would be great for LOD, if such a thing were possible.

Share this post


Link to post
Share on other sites

 

Yes, fading, as opposed to popping, would be great for LOD, if such a thing were possible.

It should be possible - how is it implemented in Animated Grass demo?

 

 

 

  • - Is dynamic based on distance?

No, just a tool to statically limit tri per surface to find out if the tri count is becoming a problem.

 

 

  • - What does this mean? Don't we already have that option? I see console commands that say skipbump, skipspecular, etc. will that be different?

We have an option that replaces material bump/specular textures with white/black images but the shaders still do the weight lifting. Same thing if a material does not have a specular or diffuse stage. The idea is to add an if/else condition to shader so that it does not have to fetch texture and do calculation that does nothing in the end.

 

 

  • - The only time I see this being useful is to test if some third party object has to much tris and you can't see it with the regular r_showTris cmd.

All tools have more or less limited use. r_showtris is sometimes visually overwhelming - and does not give you a clue about the actual count.

 

 

  • - How is this different from r_skipOverlays?

Possibly a duplicate. Need to check.

 

 

Is it only for mappers to investigate performance issues on their WIP maps?

Right. And someone should add a Wiki page with a list of things to try if a scene becomes particularly heavy.

  • Like 2

Share this post


Link to post
Share on other sites

Currently, we only can offer alpha-fading:

 

http://wiki.thedarkmod.com/index.php?title=Alpha-fading

 

Though, I suppose you could use a mult-stage material translucent material and use a parm to determine the alpha

of that material:

 

http://wiki.thedarkmod.com/index.php?title=Making_Semi-transparent_textures

 

It would be handy to have more direct access to alpha behavior for lit materials.

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

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

Share this post


Link to post
Share on other sites

There was a thread about that already, I tested the alpha fading and it just doesn't work. And replacing the regular material with 5-stage one is kind of opposite of performance tuning ;)

Edited by Judith

Share this post


Link to post
Share on other sites

There was a thread about that already, I tested the alpha fading and it just doesn't work. And replacing the regular material with 5-stage one is kind of opposite of performance tuning ;)

Can we have a test map to work on your idea?

Maybe just a giant garden with trees planted in a grid-like manner?

Share this post


Link to post
Share on other sites

In the interim, I believe we have Tels old SEED maps like this Pond map in SVN:

 

http://forums.thedarkmod.com/topic/12107-announcement-seed-system/page-6?do=findComment&comment=247177

 

(Please ignore my noob comments in that thread :blush: ...)

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

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

Share this post


Link to post
Share on other sites

In the interim, I believe we have Tels old SEED maps like this Pond map in SVN:

 

http://forums.thedarkmod.com/topic/12107-announcement-seed-system/page-6?do=findComment&comment=247177

 

(Please ignore my noob comments in that thread :blush: ...)

Mkay, from the first post in that thread SEED is something very different while LOD means that a model should have multiple detail implementations. That's great surely but I think Judith wanted the models to fade and hide at some distance.

  • Like 1

Share this post


Link to post
Share on other sites

There was a thread about that already, I tested the alpha fading and it just doesn't work.

I'm not sure whether it completely works as advertised (even a simple set-up seems frustrating to work out), but it's there; the problem is that for light-interactive materials all you can use is an alpha ramp, because of the engine limitation on partial transparency for light-interactive surfaces. Here's a test map (set Object Details to Normal or the distances may be scaled badly for the map):

 

 

 

alphaFadeTest
{
	sort almostNearest
	noShadows
	deform sprite
	nonsolid
	qer_editorimage	textures/darkmod/sfx/candleglow.tga
	{
		if (parm3 <= 1)
		//blend 		blend
		blend add
		map 		textures/darkmod/sfx/candleglow.tga
		clamp
		//alpha parm3
		rgb parm3
	}
}



alphaRampTest
{
	noShadows
	twosided
	qer_editorimage	textures/darkmod/decals/vegetation/cattail_atlas
	{
		if (parm3 <= 1)
		blend 		diffusemap
		map 		textures/darkmod/decals/vegetation/cattail_atlas
        alphatest (1 - parm3)
	}
}
Version 2
// entity 0
{
"classname" "worldspawn"
"editor_drLastCameraPos" "284.419 -30.0399 -16.4785"
"editor_drLastCameraAngle" "-10.2 203.4 0"
// primitive 0
{
brushDef3
{
( 0 0 1 -128 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 1 0 -256 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 1 0 0 -768 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 -1 0 -256 ) ( ( 0.03125 0 254 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( -1 0 0 -320 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 0 -1 64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
}
}
// primitive 1
{
brushDef3
{
( 0 0 1 -64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 1 0 -320 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 1 0 0 -768 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 0 -1 -64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( -1 0 0 -320 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 -1 0 256 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
}
}
// primitive 2
{
brushDef3
{
( 0 0 1 -64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 1 0 -256 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 1 0 0 -832 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 0 -1 -64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 -1 0 -256 ) ( ( 0.03125 0 254 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( -1 0 0 768 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
}
}
// primitive 3
{
brushDef3
{
( 0 1 0 -256 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 1 0 0 -768 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 0 -1 -128 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 -1 0 -256 ) ( ( 0.03125 0 254 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( -1 0 0 -320 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 0 1 64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
}
}
// primitive 4
{
brushDef3
{
( 0 0 1 -64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 1 0 0 -768 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 0 -1 -64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 -1 0 -320 ) ( ( 0.03125 0 254 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( -1 0 0 -320 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 1 0 256 ) ( ( 0.03125 0 254 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
}
}
// primitive 5
{
brushDef3
{
( 0 0 1 -64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 1 0 -256 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 0 -1 -64 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 0 -1 0 -256 ) ( ( 0.03125 0 254 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( -1 0 0 -384 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
( 1 0 0 320 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/darkmod/carpet/rugs/mat_shaggy" 0 0 0
}
}
}
// entity 1
{
"classname" "info_player_start"
"name" "info_player_start_1"
"origin" "-192 0 -64"
"angle" "-0.000000"
}
// entity 2
{
"classname" "atdm:ambient_world"
"name" "ambient_world"
"origin" "256 0 0"
"light_center" "0 0 0"
"light_radius" "1536 768 576"
"_color" "0.4 0.4 0.4"
}
// entity 3
{
"classname" "atdm:playertools_spyglass"
"name" "atdm_playertools_spyglass_1"
"origin" "-192 192 -64"
"rotation" "1 0 0 0 1 0 0 0 1"
"inv_map_start" "1"
}
// entity 4
{
"classname" "func_static"
"name" "func_static_1"
"model" "func_static_1"
"origin" "512 -192 0"
"dist_check_period" "0.01"
"hide_distance" "512"
"lod_1_distance" "256"
"lod_fadeout_range" "600"
// primitive 0
{
patchDef3
{
"alphaFadeTest"
( 3 3 1 1 0 0 0 )
(
( ( 512 -128 -64 0 0 ) ( 512 -128 0 0 -0.5 ) ( 512 -128 64 0 -1 ) )
( ( 512 -192 -64 0.5 0 ) ( 512 -192 0 0.5 -0.5 ) ( 512 -192 64 0.5 -1 ) )
( ( 512 -256 -64 1 0 ) ( 512 -256 0 1 -0.5 ) ( 512 -256 64 1 -1 ) )
)
}
}
}
// entity 5
{
"classname" "func_static"
"name" "func_static_2"
"dist_check_period" "0.01"
"hide_distance" "512"
"lod_1_distance" "256"
"model" "func_static_2"
"origin" "512 192 0"
"lod_fadeout_range" "300"
// primitive 0
{
patchDef3
{
"alphaRampTest"
( 3 3 1 1 0 0 0 )
(
( ( 512 256 -64 0 0 ) ( 512 256 0 0 -0.5 ) ( 512 256 64 0 -1 ) )
( ( 512 192 -64 0.5 0 ) ( 512 192 0 0.5 -0.5 ) ( 512 192 64 0.5 -1 ) )
( ( 512 128 -64 1 0 ) ( 512 128 0 1 -0.5 ) ( 512 128 64 1 -1 ) )
)
}
}
}
// entity 6
{
"classname" "atdm:playertools_lantern"
"name" "atdm_playertools_lantern_1"
"origin" "0 -64 -64"
"rotation" "1 0 0 0 1 0 0 0 1"
"inv_map_start" "1"
}

 

 

  • Like 2

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

r_showEntityDraws perf tool added in svn rev 8080.

It lists all entities in view with draw calls each generates.

  • Like 1

Share this post


Link to post
Share on other sites

Something I'd wish for would be for there to be no more leaking of indoor objects to exterior visleafs. Particles are especially notorious at this. My harbour has several hundred drawcalls coming from the ship interior's sacks, beams etc. despite being built in quite a clean way.

 

Maybe a rule could be made that if something's bounds are 90% or more within a closed visleaf it doesn't get rendered? I do remember SteveL having offered to look into this some years ago

Edited by Dragofer

Share this post


Link to post
Share on other sites

Maybe a rule could be made that if something's bounds are 90% or more within a closed visleaf it doesn't get rendered? I do remember SteveL having offered to look into this some years ago

I don't think such a rule would play well with regular models, except as an opt-in: imagine setting up a building, with a tower/spire/etc. at one end that protrudes through caulk into the next area because players will expect to be able to see it from the next street over; but then it fails to render and you're wondering why...

 

I fully agree about the problem of particles passing through walls, though.


Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

I don't think such a rule would play well with regular models

Yes, it would need some careful thought to figure out whether culling of models from closed visleafs could become more effective without having unforeseen consequences for models that touch multiple visleaves.

 

However, the problem exists also for objects that are fully contained within a single visleaf. Patches that are flush with sloped or diagonal sealing geometry are highly likely to leak despite having all their vertices precisely along the line (my ship interiors use 1:2 and sometimes 1:4 slopes on an 8 unit grid). Well I'd assume the engine draws a box around each object and finds that it intersects the diagonal line into another visleaf.

 

An opt-in would be immensely helpful, i.e. a spawnarg to tie an entity to its origin's visleaf, or until the next door (i.e. if the object spans a multi-visleaf hallway). The simplest form of this would already save hundreds of drawcalls in multiple places for me.

  • Like 1

Share this post


Link to post
Share on other sites

Yes, it would need some careful thought to figure out whether culling of models from closed visleafs could become more effective without having unforeseen consequences for models that touch multiple visleaves.

 

However, the problem exists also for objects that are fully contained within a single visleaf. Patches that are flush with sloped or diagonal sealing geometry are highly likely to leak despite having all their vertices precisely along the line (my ship interiors use 1:2 and sometimes 1:4 slopes on an 8 unit grid). Well I'd assume the engine draws a box around each object and finds that it intersects the diagonal line into another visleaf.

 

An opt-in would be immensely helpful, i.e. a spawnarg to tie an entity to its origin's visleaf, or until the next door (i.e. if the object spans a multi-visleaf hallway). The simplest form of this would already save hundreds of drawcalls in multiple places for me.

Test map?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...