Hello, i want to use 2d images as sprites for my characters, lets say 300 sprites on screen.
using billboards with them, each one using a separate new material, i get 90 fps.
using billboards, all using the same material (texture atlas), i get 86 fps.
using GeometryBatchOptimize i get 2000 fps, but they don’t face the screen = thin paper.
using point sprites i get 2000 fps but :
a) I cannot define the u-v coordinates of each sprite. My sprites don’t have the same width / height so the method setImagesX, setImagesY don’t give the desired effect. Each sprite now contains the whole atlas sprite sheet.
b) I cannot set where the position of each sprite will be. I am forced to use emitter shapes which have a predefined position. Since the sprites will be characters on screen, they can be anywhere in the world, and their position will change depending their movement, actions, goal each frame.
a) How do i solve 4a) 4b) for point sprites ?
b) It seems that the “node” system in jme is inefficient, in jogl i could render 4000 sprites at 600 fps. Anyway to bypass it so that solution 1, 2 work ?
i tried running SimpleSprite.java but it didn’t work. I get the following error :
WARNING: Bad compile of:
blablabla
com.jme3.renderer.RendererException: compile error in:ShaderSource[name=Shaders/SimpleSprite/SimpleSprite.vert, defines, type=Vertex] error:Vertex shader failed to compile with the following errors:
ERROR: 0:37: error(#160) Cannot convert from ‘float’ to ‘highp int’
ERROR: error(#273) 1 compilation errors. No code generated
plane mesh : i searched in the forum but i didn’t find anything relevant.
You mean to use just a plane ? i used quad before and it suffered from being “2d paper”, I.e it will be a “2d” plane and the viewer will be able to see it normally in one view (from front) but if he rotates 90 degrees it will be invisible.
depends on goal, in kingdom hearts 2 there are 10.000 animated sprites (that are the enemies).
@tralala: I use sprote atm in my rts, and i use quads for them. You have to correctly rotate tham though, using current camera direction.
I first pu them with their upper left corner at origin and facing positive Y, then rotate aroud Z to face the camera (fixed direction in my case), then translate to origin. Then i translate the node they are attached to to move them, it works great except when 2 quads are overlapping, then only 1 of the 2 is drawn, i didn’t figure out how to avoid that yet.
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.renderer.RendererException: compile error in:ShaderSource[name=Shaders/SimpleSprite/SimpleSprite.vert, defines, type=Vertex] error:Vertex shader failed to compile with the following errors:
ERROR: 0:40: error(#162) Wrong operand types no operation ‘%’ exists that takes a left-hand operand of type ‘highp float’ and a right operand of type ‘highp int’ (or there is no acceptable conversion)
ERROR: error(#273) 1 compilation errors. No code generated
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.renderer.RendererException: compile error in:ShaderSource[name=Shaders/SimpleSprite/SimpleSprite.vert, defines, type=Vertex] error:Vertex shader failed to compile with the following errors:
ERROR: 0:38: error(#162) Wrong operand types no operation ‘%’ exists that takes a left-hand operand of type ‘highp float’ and a right operand of type ‘highp float’ (or there is no acceptable conversion)
ERROR: error(#273) 1 compilation errors. No code generated