GearVRf icon indicating copy to clipboard operation
GearVRf copied to clipboard

About possible particle system implementation.

Open PsycoTodd opened this issue 9 years ago • 2 comments

Hello guys

I am currently trying to port some particle system into Gear VR framework. Normally for efficiency concern, the vertices and its properties are packed into a float buffer and glEnableVertexAttribArray is used to transfer the packed data to the graphics pipeline. And during the rendering stage, glDrawArrays is used to draw them.

In the current GearVR framework, in my understanding, the only way to transfer the vertex data to GPU is though GVRMesh, I may try to pack my property into the related normal, indices, texcoord of GVRMesh, and try to update the mesh data every frame since the particles change its location and position dynamically along the time. However, it is possible that the general mesh based property does not have enough entries for all my properties. And notice that we talk about update the mesh vertices/properties every frame.

Any suggestions in this case? Or do we have a project in the Gvr demo which that I can look into?

Hope to hear from you soon!

Todd

PsycoTodd avatar Apr 05 '16 19:04 PsycoTodd

Be patient because I have a fix in the works for you. I am adding multiple lighting support to GearVRF and I ran into the same problem. We explicitly bind positions, normal and texture coordinates but we don’t bind the other user defined attributes.

As part of multiple lighting support I am adding some code into the custom shader that will bind all of the vertex attributes that you define in the mesh to attributes in the shader. Then you will be able to add your own attributes to the mesh and they will make it to the GPU.

I am also adding more support for custom shader generation so that you will be able to define a shader template and make variants of it for different cases. I expect you will be able to use this functionality to implement your particle shader.

So stay tuned for improvement in this area.

From: PsycoTodd [mailto:[email protected]] Sent: Tuesday, April 5, 2016 12:17 PM To: Samsung/GearVRf [email protected] Subject: [Samsung/GearVRf] About possible particle system implementation. (#486)

Hello guys

I am currently trying to port some particle system into Gear VR framework. Normally for efficiency concern, the vertices and its properties are packed into a float buffer and glEnableVertexAttribArray is used to transfer the packed data to the graphics pipeline. And during the rendering stage, glDrawArrays is used to draw them.

In the current GearVR framework, in my understanding, the only way to transfer the vertex data to GPU is though GVRMesh, I may try to pack my property into the related normal, indices, texcoord of GVRMesh, and try to update the mesh data every frame since the particles change its location and position dynamically along the time. However, it is possible that the general mesh based property does not have enough entries for all my properties. And notice that we talk about update the mesh vertices/properties every frame.

Any suggestions in this case? Or do we have a project in the Gvr demo which that I can look into?

Hope to hear from you soon!

Todd

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHubhttps://github.com/Samsung/GearVRf/issues/486

NolaDonato avatar Apr 06 '16 02:04 NolaDonato

Dear Nola

Thank you for your help. Hope to see this function in the framework!

Todd

PsycoTodd avatar Apr 06 '16 02:04 PsycoTodd