frtru / GemParticles

Particle engine built on OpenGL used to produce various visual effects.
MIT License
34 stars 4 forks source link

GPU Particles #11

Open frtru opened 7 years ago

frtru commented 7 years ago

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:

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

NEXT STEP : FIX MVP MATRIX

frtru commented 7 years ago

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 commented 7 years ago

http://stackoverflow.com/questions/8608844/resizing-point-sprites-based-on-distance-from-the-camera

frtru commented 7 years ago

https://www.khronos.org/assets/uploads/developers/library/2014-siggraph-bof/KITE-BOF_Aug14.pdf

frtru commented 4 years ago

UPDATE: