Added compute shader n-body particle simulation demonstrating the use of shared compute shader memory
This commit is contained in:
parent
7cd95fc8c8
commit
2674c7c404
13 changed files with 1088 additions and 0 deletions
28
data/shaders/computenbody/particle.vert
Normal file
28
data/shaders/computenbody/particle.vert
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#version 450
|
||||
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
#extension GL_ARB_shading_language_420pack : enable
|
||||
|
||||
layout (location = 0) in vec3 inPos;
|
||||
layout (location = 1) in vec4 inVel;
|
||||
|
||||
layout (location = 0) out float outGradientPos;
|
||||
|
||||
layout (binding = 2) uniform UBO
|
||||
{
|
||||
mat4 projection;
|
||||
mat4 modelview;
|
||||
} ubo;
|
||||
|
||||
out gl_PerVertex
|
||||
{
|
||||
vec4 gl_Position;
|
||||
float gl_PointSize;
|
||||
};
|
||||
|
||||
void main ()
|
||||
{
|
||||
gl_PointSize = 8.0;
|
||||
outGradientPos = inVel.w;
|
||||
gl_Position = ubo.projection * ubo.modelview * vec4(inPos, 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue