Page MenuHome

Changing vertex position creates permanent lag in rasterizer and cpu.
Closed, ResolvedPublic

Description

System Information
Win 7 64 bit , Geforce 730m i5 3230m

Blender Version
Broken: 2.71

Short description of error
When setting the coordinate of (even) a single vertex (vertex.setXYZ) the rasterizer goes crazy.
http://blenderartists.org/forum/showthread.php?362541-Vertex-manipulation-and-rasterizer-issue

""" I confirmed that it is the display lists being rebuilt every frame that causes the problem.
If you disable Display Lists under Properties -> Render -> System,
the performance becomes the same as if you had already moved a vertex and does not change when you do.""" - qoute from Mobius

Exact steps for others to reproduce the error

import bge
cont = bge.logic.getCurrentController()
own = cont.owner


def main():  
    
    if cont.sensors['Keyboard'].positive:
        print( " Manipulate mesh " )
       
        sceneObjects       =   bge.logic.getCurrentScene().objects
        obj         =   sceneObjects["wave_0_0"]  
        print( obj)   
        mesh        =   obj.meshes[0]
        
        mesh_vert   =   mesh.getVertex(0,0) 

      # THIS IS THE PROBLEM
        mesh_vert.setXYZ( (0,0,0) )
     ########
            
main()

The size of the mesh increases the performance hit so this can be seen better on huge meshes that otherwise run fine in game.

Here is the gif where you can see it before and after changing one vertex position.

hacks that work

  1. replaceMesh
  2. deleting the object, changing the inactive layer's object vertex and spawning that object again in the same code run(logic tic).
  3. changng the vertex during the code run/(logic tic) when the object was added (addObject)

what i would like
""I don't know much about display lists or even if patching the BGE so it only rebuilds the display list once would be a performance improvement over calling replaceMesh.""" - Also from Mobious
Maybe that.

blend

Event Timeline

Hi vegetablejuicef, it seems that your mesh is enormous, if you make parts of your mesh and modify it differently it can be better.

Hi, sorry for the late response.

Surely, that is possible and advised, but that should not excuse the issue at hand.

The thing is( or was) that I had a energy beam that blasted through the whole map:
Either i edit 1 big mesh and get a huge lag.
Edit 4 medium meshes and get 4 medium lag spikes = huge lag.
Or I edit 10 smaller chunks which causes 10 * ( lag / 10 ) = still the same.
You get it by now I hope.

Of course, as the "fix" for this can be applied to the smaller meshes over several frames,
but then instead of being short and painful, it will be unresponsive visually and still lag.

The size of the mesh is not important, the size here was just to illustrate the problem.
It was made so that my old HD5770 could choke a little.

So yeah, I can try to shove the problem under a carpet or at least ask for it to be looked at here.

Porteries Tristan (panzergame) lowered the priority of this task from 90 to Low.May 15 2015, 2:39 PM
Angus Hollands (agoose77) raised the priority of this task from Low to Normal.May 15 2015, 7:57 PM

This has been noticed before, we should look at this at some point (i.e, not low)