Skip to content

Commit

Permalink
fix unfinished example
Browse files Browse the repository at this point in the history
  • Loading branch information
szabolcsdombi committed Jul 5, 2024
1 parent 1db3576 commit ed0e8db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ pipeline = ctx.pipeline(

```py
particle_system = ctx.pipeline(
vertex_shader=...,
fragment_shader='''
#version 330 core
Expand All @@ -197,8 +198,11 @@ particle_system = ctx.pipeline(
layout (location = 1) out vec3 OutputVelocity;
void main() {
OutputPosition = Position + Velocity;
OutputVelocity = Velocity + Acceleration;
ivec2 at = ivec2(gl_FragCoord.xy);
vec3 position = texelFetch(Position, at, 0).xyz;
vec3 velocity = texelFetch(Velocity, at, 0).xyz;
OutputPosition = position + velocity;
OutputVelocity = velocity + Acceleration;
}
''',
)
Expand Down
9 changes: 6 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ Postprocessing and Compute can be implemented as rendering a fullscreen quad.
.. code::
particle_system = ctx.pipeline(
vertex_shader=...,
fragment_shader='''
#version 330 core
Expand All @@ -198,10 +199,12 @@ Postprocessing and Compute can be implemented as rendering a fullscreen quad.
layout (location = 1) out vec3 OutputVelocity;
void main() {
OutputPosition = Position + Velocity;
OutputVelocity = Velocity + Acceleration;
ivec2 at = ivec2(gl_FragCoord.xy);
vec3 position = texelFetch(Position, at, 0).xyz;
vec3 velocity = texelFetch(Velocity, at, 0).xyz;
OutputPosition = position + velocity;
OutputVelocity = velocity + Acceleration;
}
''',
)
ZenGL intentionally does not support:
Expand Down

0 comments on commit ed0e8db

Please sign in to comment.