mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Compare commits
4 Commits
95cb0cbf67
...
bb28d7fd0e
| Author | SHA1 | Date | |
|---|---|---|---|
| bb28d7fd0e | |||
| 363855ec3e | |||
| 8ada37d967 | |||
| e7cfd3d4a3 |
@ -1,5 +1,7 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
// Input vertex attributes (from vertex shader)
|
||||
varying vec2 fragTexCoord;
|
||||
|
||||
@ -14,8 +16,7 @@ void main()
|
||||
{
|
||||
// Handle potential Y-flipping
|
||||
vec2 texCoord = fragTexCoord;
|
||||
if (flipY)
|
||||
texCoord.y = 1.0 - texCoord.y;
|
||||
if (flipY) texCoord.y = 1.0 - texCoord.y;
|
||||
|
||||
// Sample depth texture
|
||||
float depth = texture2D(depthTexture, texCoord).r;
|
||||
@ -25,4 +26,4 @@ void main()
|
||||
|
||||
// Output final color
|
||||
gl_FragColor = vec4(vec3(linearDepth), 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
#version 100
|
||||
|
||||
#extension GL_EXT_frag_depth : enable
|
||||
|
||||
precision mediump float;
|
||||
|
||||
// Input vertex attributes (from vertex shader)
|
||||
varying vec2 fragTexCoord;
|
||||
varying vec4 fragColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
@ -15,4 +17,4 @@ void main()
|
||||
|
||||
gl_FragColor = texelColor*colDiffuse*fragColor;
|
||||
gl_FragDepthEXT = 1.0 - gl_FragCoord.z;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,20 +23,20 @@ uniform float specularExponent;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 texelColor = texture(texture0, vec2(fragTexCoord.x, fragTexCoord.y));
|
||||
vec4 texelColor = texture2D(texture0, vec2(fragTexCoord.x, fragTexCoord.y));
|
||||
vec3 specular = vec3(0.0);
|
||||
vec3 viewDir = normalize(viewPos - fragPosition);
|
||||
vec3 lightDir = normalize(lightPos - fragPosition);
|
||||
|
||||
vec3 normal;
|
||||
vec3 normal = vec3(0.0);
|
||||
if (useNormalMap)
|
||||
{
|
||||
normal = texture(normalMap, vec2(fragTexCoord.x, fragTexCoord.y)).rgb;
|
||||
normal = texture2D(normalMap, vec2(fragTexCoord.x, fragTexCoord.y)).rgb;
|
||||
|
||||
//Transform normal values to the range -1.0 ... 1.0
|
||||
// Transform normal values to the range -1.0 ... 1.0
|
||||
normal = normalize(normal*2.0 - 1.0);
|
||||
|
||||
//Transform the normal from tangent-space to world-space for lighting calculation
|
||||
// Transform the normal from tangent-space to world-space for lighting calculation
|
||||
normal = normalize(normal*TBN);
|
||||
}
|
||||
else
|
||||
@ -56,7 +56,7 @@ void main()
|
||||
|
||||
specular += specCo;
|
||||
|
||||
finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0)));
|
||||
vec4 finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0)));
|
||||
finalColor += texelColor*(vec4(1.0, 1.0, 1.0, 1.0)/40.0)*tint;
|
||||
|
||||
// Gamma correction
|
||||
|
||||
@ -939,22 +939,22 @@ int main(int argc, char *argv[])
|
||||
UnloadImage(imScreenshot);
|
||||
|
||||
// Validate: raylib/examples/Makefile -> Example listed?
|
||||
if (FileTextFind(TextFormat("%s/Makefile", exBasePath), exInfo->name) == -1) exInfo->status |= VALID_NOT_IN_MAKEFILE;
|
||||
if (FileTextFindIndex(TextFormat("%s/Makefile", exBasePath), exInfo->name) == -1) exInfo->status |= VALID_NOT_IN_MAKEFILE;
|
||||
|
||||
// Validate: raylib/examples/Makefile.Web -> Example listed?
|
||||
if (FileTextFind(TextFormat("%s/Makefile.Web", exBasePath), exInfo->name) == -1) exInfo->status |= VALID_NOT_IN_MAKEFILE_WEB;
|
||||
if (FileTextFindIndex(TextFormat("%s/Makefile.Web", exBasePath), exInfo->name) == -1) exInfo->status |= VALID_NOT_IN_MAKEFILE_WEB;
|
||||
|
||||
// Validate: raylib/examples/README.md -> Example listed?
|
||||
if (FileTextFind(TextFormat("%s/README.md", exBasePath), exInfo->name) == -1) exInfo->status |= VALID_NOT_IN_README;
|
||||
if (FileTextFindIndex(TextFormat("%s/README.md", exBasePath), exInfo->name) == -1) exInfo->status |= VALID_NOT_IN_README;
|
||||
|
||||
// Validate: raylib.com/common/examples.js -> Example listed?
|
||||
if (FileTextFind(TextFormat("%s/../common/examples.js", exWebPath), exInfo->name + TextFindIndex(exInfo->name, "_") + 1) == -1) exInfo->status |= VALID_NOT_IN_JS;
|
||||
if (FileTextFindIndex(TextFormat("%s/../common/examples.js", exWebPath), exInfo->name + TextFindIndex(exInfo->name, "_") + 1) == -1) exInfo->status |= VALID_NOT_IN_JS;
|
||||
|
||||
// Validate: raylib/projects/VS2022/examples/<category>_example_name.vcxproj -> File exists?
|
||||
if (!FileExists(TextFormat("%s/../projects/VS2022/examples/%s.vcxproj", exBasePath, exInfo->name))) exInfo->status |= VALID_MISSING_VCXPROJ;
|
||||
|
||||
// Validate: raylib/projects/VS2022/raylib.sln -> Example listed?
|
||||
if (FileTextFind(TextFormat("%s/../projects/VS2022/raylib.sln", exBasePath), exInfo->name) == -1) exInfo->status |= VALID_NOT_IN_VCXSOL;
|
||||
if (FileTextFindIndex(TextFormat("%s/../projects/VS2022/raylib.sln", exBasePath), exInfo->name) == -1) exInfo->status |= VALID_NOT_IN_VCXSOL;
|
||||
|
||||
// Validate: raylib/examples/<category>/resources/.. -> Example resources available?
|
||||
// Scan resources used in example to check for missing resource files
|
||||
|
||||
Reference in New Issue
Block a user