mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Support multiple sample2D on batch drawing #1333
This commit is contained in:
21
examples/shaders/resources/shaders/glsl100/color_mix.fs
Normal file
21
examples/shaders/resources/shaders/glsl100/color_mix.fs
Normal file
@ -0,0 +1,21 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
// Input vertex attributes (from vertex shader)
|
||||
varying vec2 fragTexCoord;
|
||||
varying vec4 fragColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform sampler2D texture0;
|
||||
uniform sampler2D texture1;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Texel color fetching from texture sampler
|
||||
vec4 texelColor0 = texture2D(texture0, fragTexCoord);
|
||||
vec4 texelColor1 = texture2D(texture1, fragTexCoord);
|
||||
|
||||
gl_FragColor = (texelColor0 + texelColor1)*0.5f;
|
||||
}
|
||||
22
examples/shaders/resources/shaders/glsl330/color_mix.fs
Normal file
22
examples/shaders/resources/shaders/glsl330/color_mix.fs
Normal file
@ -0,0 +1,22 @@
|
||||
#version 330
|
||||
|
||||
// Input vertex attributes (from vertex shader)
|
||||
in vec3 vertexPos;
|
||||
in vec2 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform sampler2D texture0;
|
||||
uniform sampler2D texture1;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
out vec4 finalColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Texel color fetching from texture sampler
|
||||
vec4 texelColor0 = texture(texture0, fragTexCoord);
|
||||
vec4 texelColor1 = texture(texture1, fragTexCoord);
|
||||
|
||||
finalColor = (texelColor0 + texelColor1)*0.5f;
|
||||
}
|
||||
Reference in New Issue
Block a user