Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU Particles #11

Open
frtru opened this issue Dec 2, 2016 · 9 comments
Open

GPU Particles #11

frtru opened this issue Dec 2, 2016 · 9 comments

Comments

@frtru
Copy link
Owner

frtru commented Dec 2, 2016

NOTE: As seen here https://github.com/amulware/genericgamedev-gpu-particles/tree/cpu-gpu-comparison/GenericGamedev.Pixelation
The CPUSimpleParticles.cs, AlmostGPUParticles.cs and GPUParticles.cs demonstrate how you can completely render/update on the GPU.

List of things to do for this:

  • Need to add a call from app to particlesystem or something else
  • Maybe add renderers or entities that can iterate through all the pool particles and render and use the camera and add some special effects i guess
  • I need to provide minimal implementation in the shaders (take the matrices and multiply it with the vertex location)

SEE THIIIS
http://stackoverflow.com/questions/8608844/resizing-point-sprites-based-on-distance-from-the-camera he uses a sampler2darray as a uniform, would it be possible that way?

COMPUTE SHADERS

@frtru frtru added the task label Dec 2, 2016
@frtru frtru added this to the First draft of CPU implementation completed milestone Dec 2, 2016
@frtru frtru self-assigned this Dec 2, 2016
frtru added a commit that referenced this issue Dec 7, 2016
…y, the scheme will be that the renderers will render an "effect" to the particles. For example, the stub one will be used for debugging purposes and will render red transparent squares. TBD: An higher driver-like class or "effect" as fenbf did might be needed to compose many types of renderers (e.g. explosions have many textures applied to particles)
@frtru
Copy link
Owner Author

frtru commented Dec 7, 2016

Copy from the commit comment : Added a really early version of the renderers. Basically, the scheme will be that the renderers will render an "effect" to the particles. For example, the stub one will be used for debugging purposes and will render red transparent squares. TBD: An higher driver-like class or "effect" as fenbf did might be needed to compose many types of renderers (e.g. explosions have many textures applied to particles)

frtru added a commit that referenced this issue Dec 8, 2016
…ems. It solves the issue of rendering multiple texture particles. Still need to find an efficient way to link with the renderers
frtru added a commit that referenced this issue Dec 10, 2016
…ystem->particlesystemComponent. Replaced the map<string,system> by vector<pair<particlecomponent,renderer> > in the module/system so that the renderer is bound to the particlecomponent not only by a string. Still have an implementation issue in the new system .cc file and didn<t update the renderer according to those changes yet. Draft of the rendering process in the stub_renderer class.
@frtru
Copy link
Owner Author

frtru commented Dec 10, 2016

I need to finish the task for the camera in order to complete this one. I need to send the matrices to the shaders as well.

frtru added a commit that referenced this issue Dec 11, 2016
…class. Reworked the whole renderer architecture to another layers for "opengl_renderers". Completed the link with the particles and the renderer. Still need to finish the stub_renderer rendering and to provide a link with the camera's matrices.
frtru added a commit that referenced this issue Dec 18, 2016
…O for the color as fenbf does...Solved a linker error by adding Opengl32.lib to the project and I fixed an error at runtime by changing the m_position to m_position[0] for the first call to glbufferdata, needs to be investigated. Also need to link somewhere the camera and put the layout 1 in the shaders
@frtru
Copy link
Owner Author

frtru commented Dec 18, 2016

Finall found out that the model matrix doesn't matter in our system because we update the vertices position directly. With a model loaded, it basically comes like a big array in which we don't want to modify the vertices individually and we give it a model matrix and forward that model matrix to the shaders.

frtru added a commit that referenced this issue Dec 19, 2016
…LOT of temporary things in order to get things working. Seems like there's an issue with particles dynamics, they all have the same positions and velocity... Also, forwarding the color from CPU to GPU doesn't seem to work, might have to try reguler vectors from glm as a test.
@frtru
Copy link
Owner Author

frtru commented Jan 27, 2017

Just noticed that the issue I was attacking was because the MVP wasnt defined and it defaulted to 0 everywhere and when I multiplied it with the positions, it puts all the particles at 0,0,0....

@frtru frtru added the bug label Jan 27, 2017
@frtru frtru changed the title I need a functional rendering loop FIX MVP MATRIX/I need a functional rendering loop Jan 27, 2017
frtru added a commit that referenced this issue Jan 27, 2017
…not defined so it was a null matrix and it was multiplied by the position in input in the shader, so the output was always at the origin. SO THIS IS THE NEXT PRIORITY. Also, added/Instrumented some debugging tools suck as 3d axis. Fixed the GL_FLOAT to GL_UNSIGNED_BYTE for the uvec4 types.
@frtru
Copy link
Owner Author

frtru commented Jan 27, 2017

NEXT STEP : FIX MVP MATRIX

frtru added a commit that referenced this issue Jan 29, 2017
…app.cc temporarily in order to concentrate on the camera. Added an union of projection parameters and the view parameters as well. Re-added the MVP matrix in the shader.
@frtru frtru closed this as completed Jan 29, 2017
@frtru frtru reopened this Feb 5, 2017
@frtru frtru changed the title FIX MVP MATRIX/I need a functional rendering loop GPU Particles Feb 5, 2017
@frtru
Copy link
Owner Author

frtru commented Feb 5, 2017

NOTE: As seen here https://github.com/amulware/genericgamedev-gpu-particles/tree/cpu-gpu-comparison/GenericGamedev.Pixelation
The CPUSimpleParticles.cs, AlmostGPUParticles.cs and GPUParticles.cs demonstrate how you can completely render/update on the GPU.
Also see how fenbf does it.

@frtru frtru modified the milestones: Final draft of the CPU implementation, First draft of CPU implementation completed Feb 5, 2017
@frtru frtru removed this from the Final draft of the CPU implementation milestone Feb 5, 2017
@frtru
Copy link
Owner Author

frtru commented Feb 21, 2017

@frtru
Copy link
Owner Author

frtru commented Mar 8, 2017

@frtru frtru removed their assignment Mar 9, 2017
@frtru frtru self-assigned this Oct 12, 2017
@frtru
Copy link
Owner Author

frtru commented Jul 6, 2020

UPDATE:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant