Can use ray to set all objects with property or material visible unvisible?

I try with logic bricks and fail. with script can work? All objects have same material is a foliage of render particle system.I tryng optimize game.

you need to take some time and explain what you are trying to do*

im in open world level have a cube sky animating cant use mist or i cant see the sky.Can set Mist Z axis? then i can use near for render or not objects but and back camera will render?

i trying made large vegetacion and lost many frames.If i use large texture with < quantity of faces can get more performance?

foliage with 800x800 use 3000 with 8 faces = 24000 faces if use texture 4096x4096 can scale a lot and earn more area of terrain i think with 2000 can cover same area.90% more performance?Using render particles system to foliages Have anything method better?

ensure all plants are under 128 vertex
use upbge geometry instancing.

b. loop through all scene objects and set distant objects invisible / suspend physics using python

about the fog

c. set the distance of the fog to be after the clip distance of camera

big textures for things are meant for atlas where many objects use 1 material.

if all objects in scene are all using 1 material you can use upbge static mesh batching (per terrain tile or whole world depends on scale)

without instancing or batching = 1 draw call per object * num of materials per ob

with instancing = 1 drawcall forl instances of 1 geometry/mesh (alt d or group instance or replace mesh w/ same mesh)

with static mesh batching = all static objects sharing 1 material = 1 batch

less render batches = higher framerate
also physics meshes need to be considered.

invisible*

yes in particles render i,m using just 1 material but forget upbge i got a lot of bugs with my project.I return to blender 2.76 only this can work with shadows for me.

the batch mesh its possible use in bge?

the plants have a 16 max 32 vertices per object

I m using camera clip 1800 cause cube sky ia very Big then mist for start in 1850 doesnt help me i think :frowning:

I use Alt +D always for work with particles render vegetacion.tell more about replace mesh with same mesh.its confuse for me

game objects can be shifted -> replace mesh -> replace properties

it’s like a object can mutate to another - works best with objects with no logic.

a ‘Visiting factory’ can create and maintain logic like this

def command1(data):
    #do something
    pass

commandDict = { 'command1':command1 }

for gameObject in listOfObjects:
    commands = gameObject['Commands'] 
    for command in commands:
         function = commandDict[command[0]]
         function(command[1])

where each object commands looks like this

object['Commands'] = [ ['SomeFunctionName', [any data you need] ] , ['SomeOtherFunctionName', [data2] ]  ]

so by reskining a object -> changing it’s properties you can essientially make it into a new obect.

object.replaceMesh(‘SomeMesh’,1,1)
propertyList = object.getPropertyNames()

for property in propertyList:
    del object['property']

for prop in savedPropList:
    object[prop[0]] = prop[1]

we can store a list of tuples that are

[( ‘propertyName’, Value),(‘property2’,value2) ]

(so we can save a object’s old identity that is outside the range of the player
mutate it -> stick new logic in it and make it a new thing.

it’s much faster than end -> add object all the time.

About def def command 1

will use for range object from player?

Ray?

and all this code will use after create example 4000 objects in particles render system?

use the builtin lod. any python lod at that scale would be crazy slow.

use the particles to scatter empties of a special name around the scene. eg “xENV_SPAWN.name.000”.

your startup script will loop through all the objects. add grass to the empties, the destroy the empties.

cleanup = []
for obj in scene.objects:
if "xENV_SPAWN" in obj.name and level == 3:
grass = scene.addObject("grassobj", obj, 0)
cleanup.append(obj)

# clean the map of garbage objects
for g in cleanup:
g.endObject()

now you can create one grass object on inactive layer and create lods and things on one object. you can even create a mesh and delete all verts for your far lod.

cursed markdown

i quit. im sure you can figure it out.

thanks for help.I have a grass object with only 4 faces.decimate not have effect.
and what about distance?will use LOD?

How can insert empty to all particles system?

loop = 100
if for i in range(loop):
    target = own['objectList'][own['index']]
    if player.getDistanceTo(target)<min distance:
        if 'physics' not in target:
            target['physics'] = true
            target.visible = True
            target.restorePhysics()
     elif 'physics' in target:
        del target['physics']
        target.visible = False
        target.suspendPhysics()

    own['index']+=1
    if own['index'] > len(own['objectList'])-1: 
        own['index']=0

friend its a no colission object no have physics just look picture an look FPS before of this 900 objects rendered concentrate with particle systems was 180FPS now 28FPS

Visual is good but very low kill machine!

Dude you need LOD on those plants.

you could probably also spread them out,
and not use so many,

less plantey in general.

but one object have just 4 faces planes how make lod of that understand?
My estimate is 900 objects with 3600 faces.For i made level of details(LOD) you tell me
Control + J after particles system rendered and converted? In this case would have 1 object only
Decimate not work

  • The more object you have the slower bge gets.
  • The higher the textures, the slower bge gets.
  • using alpha makes bge slower.
  • using non instanced objects makes bge slower. (alt+d is better then shift+d)

not hard to understand right?

You need LoD for the grass/plants. as mentioned before.
combine the grass so you get less objects, make patches of like 5m2-10m2, and use the in-game Lod system for it, need python lod? search for my resources (if they still work, forum is screwed up).

to grab all objects with a property all_objects = [obj for obj in own.scene.objects if 'property_name' in obj]

now you have a list with all items that carry the property.
then you can do something like

for obj in all_objects: obj.visible = False
this turns all the objects in the list to invisible.

Hi friend i use alt+D for create the object then create a group for create particcles system in render
yes using aplha how can get a good effect vegetation without?

please look this video

i think go try made level of details like in this video, after go to distance. Will work in edit mode separate parts P

after back thanks

my problem is not objects is alpha map in objects.I talk with friend he use UDK and UDK work with black for give transparence no use alpha like blender.i this we need start think in optimize this channel alpha