low/mid/high settings, how to do it with textures?

Hello,

While i am still waiting to get my graphic card back from rma, my old card gets a hard time with a level that i am making.
I found out that the Normal maps and specular maps are causing frames to drop (5-10 fps 60 to 50-55) and its creating some stutter.

I tried to aply lower textures (512 instead of 1024) and ofc. this worked.

So now i want to create low/high settings, texture wise into the game, but what is a good way to do it?

I was thinking about meshes with low and 1 with high resolution and combine that with my lod. Or add a second material on the object and switch it on startup with python, or just intergrate it into my game laucher and find some way to select a directory for the textures.

I have no clue if the last one is possible, if it is i would like to have that option.

Is there a good/effective way to do this?
anyone able to help me out?

Cotaks

https://pythonapi.upbge.org/bge.types.KX_LodLevel.html
This says the mesh is read only for LOD levels,

I think high / low setting should effect the name of the files to libLoad.

One could also libLoad the mesh, with a blank texture and load the texture separate and pop it into the texture slot, using pyOpen GL or the video texture module.

like BPR said, have a couple of game asset blends with the various qualities. then libload the right one on run time.

This says the mesh is read only for LOD levels,

indeed, but this is details for the build-in lod right? Im am not using the build-in version. so i can just alter the materials of the mesh

I think high / low setting should effect the name of the files to libLoad.

did not even come up to me to use libload for it, this will work in an easy way. thanks.

Be careful with “texture levels” - If you have on an inactive layer an object with a 512 texture, one with a 1024 and one with a 2048 texture, you will use more VRAM than if you just had one with a 2048 texture.

Also, for textures, you can use the dynamic texture module to swap them in/out.

Be careful with “texture levels” - If you have on an inactive layer an object with a 512 texture, one with a 1024 and one with a 2048 texture, you will use more VRAM than if you just had one with a 2048 texture.

This i know, and i was worried about it, but i can use it just like 1 texture a time, so low is low and not mixed with high textures as well.

Also, for textures, you can use the dynamic texture module to swap them in/out.

oh, im going to look into it, thanks

I use different materials for different lod levels…my current wip level has just under 500 trees…not insane amount I know, but high for a large opn world and a 5k view distance…my framerate without AO is still @100 fps from the character view and when I move the player up to see more of the level(more visible trees and less occluders) it only goes down to @95 fps…I drop the resolution by half every lod and the final lod(furthest) are only criss crossing planes with alpha clip and no shadows. For me…this increased my fps to more that 2x what it was before I implemented the lod’s…also only lod 0(nearest) has collision and even that is simplified from the base mesh.

5k view haha i am at 300m view with a terrain of 100x100m but i house 1000+ objects on the island. i got 45 fps in the mid/near center, on the outside i still got 60 (yeah vsync). this is including: dof, fxaa,ssao and bloom filters @ 1920x1200 on hd 7850 1GB.


so i gonna add libload to the party and then i can just toggle the settings with the launcher.
but maybe my textures got way to much details, because if i look down to my sand/grass it looks like this:


im just gonna try and see i it helps

I am using mostly per face textures…I am using a B&W stencil map for dirt to grass transition…I have found it to be faster to have stone(cliffs or whatever) to be a separate object, then I just use the single stencil to blend dirt + grass…or whatever…I am still just screwing around in my main world
@381K tris(no idea about actual vertex count or how they are counted…two faces sharing an edge counts each vert once or twice…???)
and I am pruning trees atm…e.g. deleting some :slight_smile: they are placeholder anyway…still getting the feel for UPBGE/BGE and I have no reason for a 5K draw…standard 2m high character, I will probably go with 2k in the end, with options for larger draw distances I just tested 10K and get 45-50fps, but the world is largely un-populated.

I would recommend taking it easy on the shaders…also disable you screen space shaders to see if those are a bottleneck…I am getting the impression that BGE/UPBGE are very cpu intensive…I have yet to test that theory…

also setup LOD for those small plants to about 200 to be just an object with no verticies…you will get console errors, but it should not be reflected once published…you can PM me if you want…I’m no ‘master builder’ with the game engine, but I could probably squeeze out a higher frame rate, or at least test it and point out some faster options…I would love to help. Everyone here has been holding my hand through my ordeal :slight_smile:

*EDIT: how far are your shadows reaching…I know that is a big problem for me in my game.

@381K tris(no idea about actual vertex count or how they are counted…two faces sharing an edge counts each vert once or twice…???)

I have no idea about how that counter does work, but I do know that in a game engine, if a face is flat-shaded or has split UV’s, then the verts should be counted per connected face. So if you have a normal six sided cube, with smooth shading it has 8 verts. With flat shading it has 24

yep, UV seams add to the vertex count. Some shaders also add to it…but I don’t know if anyone has done any lengthy testing…or if it will all change with eevee…I guess in the end it does not add too much…unless you are doing something drastically wrong…like per face uv’s :slight_smile:

getting the impression that BGE/UPBGE are very cpu intensive…I have yet to test that theory…

I can tell you directly, No bge is not cpu intensive. This morning i had phenom II x4 965 be @ 3.6Ghz. this afternoon package arived with amd ryzen 5 1600 @ 3.2Ghz and i went from 8 gb ram to 16 gb ram, nothing changed same results as with old setup.

.I am using a B&W stencil map for dirt to grass transition

i’m using a node setup to mix 3 texures on vertex colors.

also setup LOD for those small plants to about 200 to be just an object with no verticies…you will get console errors

errors? anyway i am using my own lod, and grass is 4 planes at distance i will load in a billboard mesh with 1 plane, same with the bush.

I would recommend taking it easy on the shaders…also disable you screen space shaders to see if those are a bottleneck

They arent, well they can be ofcourse but they were already there before it hppend, i added the beach and grass normals then it dropped, so i know it are the textures.

how far are your shadows reaching…I know that is a big problem for me in my game

clip end 50 with a 30 frustom at 2048 size, it still looks terrible xD

lol, my shadows are just horrible…I am still trying to find a work around that is dynamic and not using static shadows…due to it being open world I have some overhanging rocks and things so the clip range is WAYYYYY to high, but without it…there are no shadows where they should be :slight_smile: I’m still fumbling around with the bge, but I’m getting it slowly but surely. Are you going to post in the WIP section…I am curious to see what you are up to :)?

Are you going to post in the WIP section…I am curious to see what you are up to :)?

I don’t think that i’m going to post it in the WiP section, this is just a small game that i work on if i have time.
it’s more of a test setup to test new things that i’m creating.

It will probably never become a real game, maybe ill replace my fps package with this game.
So things are uptodate and cleaned up. but dont hold your breath for it, nothing is sure.

I get it…you seem to know your way around the engine and the scripting side…I myself tend to start projects to only work on a specific function or the way a model interacts…or just because I get a crazy idea :slight_smile:

I can suggest to everyone to start a thread like my “sdfgeoff’s node shaders and other experiemnts” where you post whatever random things you come up with…

Thats a good idea, but i got already an topic in resources, with the resources that i share.

I get it…you seem to know your way around the engine and the scripting side…I myself tend to start projects to only work on a specific function or the way a model interacts…or just because I get a crazy idea https://blenderartists.org/forum/images/smilies/sago/smile.gif

i manage may way around indeed, but still tons to learn, it never ends, you always find some new piece of code that you think wtf if i knew that before etc. :slight_smile:

but i love to program in my free time, so i like to mess around in blender alot.

I am probably going to add some resources soon…I want to make sure I have something useful to offer first, but the resources forum was a great idea.