mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Created Default shader parameters (markdown)
42
Default-shader-parameters.md
Normal file
42
Default-shader-parameters.md
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
The default shaders included in raylib defines the following default input and output parameters if no user-provided vertex or fragment shader is provided.
|
||||||
|
|
||||||
|
Source: [rlgl.h](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
|
||||||
|
|
||||||
|
## Default vertex shader
|
||||||
|
|
||||||
|
OPENGL_ES2 or OPENGL_21
|
||||||
|
```
|
||||||
|
attribute vec3 vertexPosition;
|
||||||
|
attribute vec2 vertexTexCoord;
|
||||||
|
attribute vec4 vertexColor;
|
||||||
|
varying vec2 fragTexCoord;
|
||||||
|
varying vec4 fragColor;
|
||||||
|
```
|
||||||
|
|
||||||
|
OPENGL_33
|
||||||
|
```
|
||||||
|
in vec3 vertexPosition;
|
||||||
|
in vec2 vertexTexCoord;
|
||||||
|
in vec4 vertexColor;
|
||||||
|
out vec2 fragTexCoord;
|
||||||
|
out vec4 fragColor;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Default fragment shader
|
||||||
|
|
||||||
|
OPENGL_ES2 or OPENGL_21
|
||||||
|
```
|
||||||
|
varying vec2 fragTexCoord;
|
||||||
|
varying vec4 fragColor;
|
||||||
|
```
|
||||||
|
OPENGL_ES2 also defines
|
||||||
|
```
|
||||||
|
precision mediump float;
|
||||||
|
```
|
||||||
|
|
||||||
|
OPENGL_33
|
||||||
|
```
|
||||||
|
in vec2 fragTexCoord;
|
||||||
|
in vec4 fragColor;
|
||||||
|
out vec4 finalColor;
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user