Grass swaying experiment

A little test done in upbge:
download

there are some parameters to change in the code which include speed and damping. Enjoy :slight_smile:


looks good, but 25 FPS…and only the grass is what is in the scene…I have to wonder if that is just hardware related?..I don’t mean to sound like I have nothing nice to say :wink: I just think it may need optimization.

I think it’s because the sway is calculated on the cpu and there is also some python overhead (translation time between python and bge) that slow it down.
In generell if you don’t need physics then the vertex manipulation should be done on the gpu with shaders in my opinion. But shaders are complex and have also limitations in the bge at the moment.

But anyway it’s nice test Nicholas_A. :slight_smile:

we really could use ‘bullet 3 core’ so pyBullet could replace most of the bullet bindings…

i get a framarate of 14.2.i am on a hewlett packard
desktop.Grass would be great with dynamic terrain loading.

The low framerate isnt even the python. That only accounts for a loos of ~6 fps. Using a near actuator, I was disabled swaying when the camera was far away and when all the grass was off, framerate was 31. If you guys have any improvements, please share them!

Set material constants to on( and alpha sort with shadow is a no good for now). What @Maujoe said. :slight_smile: To make the shader faster you need to write it as a build-in shader, that way it will get cached.

Well, I get 40fps in UPBGE and 150~185fps in BGE.
+1 for BGE :wink:


@haidme It looks like that you forgot to set the shading to GLSL in the BGE. So it’s not a fair match… :stuck_out_tongue: :wink:

Haha…I admit, I just opened the file in bge and then in upbge.
BGE with GLSL on:


:smiley:

Dont forget to set the storage to VBO. Upbge uses vbo+vao. My results are upbge: 30fps, bf bge 47fps.

where is storage in the upbge?

Only bge have storage.

storage? What do you mean by storage?

In render tab->system ->storage(VA, VBO, in 2.8 its only vbo.)

Ive made a issue, link: https://github.com/UPBGE/blender/issues/505 You can see from the image, that the scenegraph takes the fps. I dont remember if that was from a bug fix in the scenegraph or a new issue.

ah, vertex array/buffer object…gotcha :wink: