Skip to content

Commit

Permalink
explain how to do fullscreen passes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbritain committed Jan 4, 2025
1 parent 22f71fa commit efe9b28
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions src/content/docs/aperture/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ You **must** register a combination pass, this is like `final` and writes the fi
:::


## Writing Shader Programs
## Object Shaders

### Vertex Shaders
Object shaders require special handling to allow for mod support

### Vertex
Vertex shaders should define two functions:

#### `void iris_emitVertex(inout VertexData data)`
Expand Down Expand Up @@ -91,10 +93,30 @@ struct VertexData {
};
```

### Fragment Shaders
### Fragment

Fragment shaders are a lot simpler, you just define `void iris_emitFragment()` instead of `void main()`.

## Composite Shaders

### Vertex

Since Aperture uses the core profile, `ftransform()` is not patched. Instead, the position of the vertex and the UV must be manually calculated as follows.

```glsl
#version 450 core
out vec2 uv;
void main() {
vec2 position = vec2(gl_VertexID % 2, gl_VertexID / 2) * 4.0 - 1.0;
uv = (position + 1.0) * 0.5;
gl_Position = vec4(position, 0.0, 1.0);
}
```

## Uniforms

:::caution[Warning]
Expand Down

0 comments on commit efe9b28

Please sign in to comment.