Skip to content

Commit

Permalink
draw the rest of the owl
Browse files Browse the repository at this point in the history
  • Loading branch information
Razish committed Feb 19, 2024
1 parent 9ca4d96 commit 0b92929
Show file tree
Hide file tree
Showing 19 changed files with 125 additions and 125 deletions.
14 changes: 7 additions & 7 deletions cmake/Modules/InstallZIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,35 @@ if(WIN32)
set(ZIP_COMMAND "${ZIP_EXECUTABLE}" -P "<ARCHIVE>" <FILES>)
endif()
endif()

if(NOT ZIP_EXECUTABLE)
find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramW6432}/WinZip")
if(ZIP_EXECUTABLE)
set(ZIP_COMMAND "${ZIP_EXECUTABLE}" -P "<ARCHIVE>" <FILES>)
endif()
endif()

if(NOT ZIP_EXECUTABLE)
find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
if(ZIP_EXECUTABLE)
set(ZIP_COMMAND "${ZIP_EXECUTABLE}" a -tzip "<ARCHIVE>" <FILES>)
endif()
endif()

if(NOT ZIP_EXECUTABLE)
find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramW6432}/7-Zip")
if(ZIP_EXECUTABLE)
set(ZIP_COMMAND "${ZIP_EXECUTABLE}" a -tzip "<ARCHIVE>" <FILES>)
endif()
endif()

if(NOT ZIP_EXECUTABLE)
find_program(ZIP_EXECUTABLE winrar PATHS "$ENV{ProgramFiles}/WinRAR")
if(ZIP_EXECUTABLE)
set(ZIP_COMMAND "${ZIP_EXECUTABLE}" a "<ARCHIVE>" <FILES>)
endif()
endif()

if(NOT ZIP_EXECUTABLE)
find_program(ZIP_EXECUTABLE winrar PATHS "$ENV{ProgramW6432}/WinRAR")
if(ZIP_EXECUTABLE)
Expand All @@ -85,7 +85,7 @@ if(NOT ZIP_EXECUTABLE)
else()
find_program(ZIP_EXECUTABLE zip)
endif()

if(ZIP_EXECUTABLE)
set(ZIP_COMMAND "${ZIP_EXECUTABLE}" -r "<ARCHIVE>" . -i<FILES>)
endif()
Expand All @@ -94,7 +94,7 @@ endif()
function(add_zip_command output)
set(MultiValueArgs FILES DEPENDS)
cmake_parse_arguments(ARGS "" "" "${MultiValueArgs}" ${ARGN})

set(ZipCommand ${ZIP_COMMAND})
string(REPLACE <ARCHIVE> "${output}" ZipCommand "${ZipCommand}")
string(REPLACE <FILES> "${ARGS_FILES}" ZipCommand "${ZipCommand}")
Expand Down
4 changes: 2 additions & 2 deletions codemp/rd-rend2/glsl/bokeh.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void main()
tc = var_TexCoords + u_InvTexRes * vec2( -c[3], -c[3]); color += texture(u_TextureMap, tc);
tc = var_TexCoords + u_InvTexRes * vec2( -c[4], -c[2]); color += texture(u_TextureMap, tc);
tc = var_TexCoords + u_InvTexRes * vec2( -c[5], -c[1]); color += texture(u_TextureMap, tc);

out_Color = color * 0.04166667 * u_Color;
#endif

Expand All @@ -81,6 +81,6 @@ void main()
tc = var_TexCoords + u_InvTexRes * vec2( -c[1], -c[3]); color += texture(u_TextureMap, tc);
tc = var_TexCoords + u_InvTexRes * vec2( -c[2], -c[2]); color += texture(u_TextureMap, tc);
tc = var_TexCoords + u_InvTexRes * vec2( -c[3], -c[1]); color += texture(u_TextureMap, tc);

out_Color = color * 0.0625 * u_Color;
}
4 changes: 2 additions & 2 deletions codemp/rd-rend2/glsl/calclevels4x.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ void main()
current = GetValues(vec2(-0.5, -1.5), current);
current = GetValues(vec2( 0.5, -1.5), current);
current = GetValues(vec2( 1.5, -1.5), current);

current = GetValues(vec2(-1.5, -0.5), current);
current = GetValues(vec2(-0.5, -0.5), current);
current = GetValues(vec2( 0.5, -0.5), current);
current = GetValues(vec2( 1.5, -0.5), current);

current = GetValues(vec2(-1.5, 0.5), current);
current = GetValues(vec2(-0.5, 0.5), current);
current = GetValues(vec2( 0.5, 0.5), current);
Expand Down
12 changes: 6 additions & 6 deletions codemp/rd-rend2/glsl/depthblur.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ vec4 depthGaussian1D(sampler2D imageMap, sampler2D depthMap, vec2 tex, float zFa
#else // if defined(USE_VERTICAL_BLUR)
vec2 direction = vec2(0.0, 1.0) * scale;
#endif

float depthCenter = zFar * getLinearDepth(depthMap, tex, zFarDivZNear);
vec2 centerSlope = vec2(dFdx(depthCenter), dFdy(depthCenter)) / vec2(dFdx(tex.x), dFdy(tex.y));

vec4 result = texture(imageMap, tex) * gauss[0];
float total = gauss[0];

Expand All @@ -69,14 +69,14 @@ vec4 depthGaussian1D(sampler2D imageMap, sampler2D depthMap, vec2 tex, float zFa
total += gauss[j];
}
}

direction = -direction;
}
}

return result / total;
}

void main()
{
{
out_Color = depthGaussian1D(u_ScreenImageMap, u_ScreenDepthMap, var_ScreenTex, u_ViewInfo.x, u_ViewInfo.y);
}
6 changes: 3 additions & 3 deletions codemp/rd-rend2/glsl/down4x.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void main()
{
vec4 color;
vec2 tc;

tc = var_TexCoords + u_InvTexRes * vec2(-1.5, -1.5); color = texture(u_TextureMap, tc);
tc = var_TexCoords + u_InvTexRes * vec2(-0.5, -1.5); color += texture(u_TextureMap, tc);
tc = var_TexCoords + u_InvTexRes * vec2( 0.5, -1.5); color += texture(u_TextureMap, tc);
Expand All @@ -45,8 +45,8 @@ void main()
tc = var_TexCoords + u_InvTexRes * vec2(-0.5, 1.5); color += texture(u_TextureMap, tc);
tc = var_TexCoords + u_InvTexRes * vec2( 0.5, 1.5); color += texture(u_TextureMap, tc);
tc = var_TexCoords + u_InvTexRes * vec2( 1.5, 1.5); color += texture(u_TextureMap, tc);

color *= 0.0625;

out_Color = color;
}
2 changes: 1 addition & 1 deletion codemp/rd-rend2/glsl/fogpass.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ vec3 DeformNormal( const in vec3 position, const in vec3 normal )

vec3 outNormal = normal;
const float scale = 0.98;

outNormal.x += amplitude * GetNoiseValue(
position.x * scale,
position.y * scale,
Expand Down
18 changes: 9 additions & 9 deletions codemp/rd-rend2/glsl/generic.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ vec3 DeformNormal( const in vec3 position, const in vec3 normal )

vec3 outNormal = normal;
const float scale = 0.98;

outNormal.x += amplitude * GetNoiseValue(
position.x * scale,
position.y * scale,
Expand Down Expand Up @@ -298,7 +298,7 @@ vec2 GenTexCoords(int TCGen, vec3 position, vec3 normal, vec3 TCGenVector0, vec3
}
break;
}

return tex;
}
#endif
Expand All @@ -313,18 +313,18 @@ vec2 ModTexCoords(vec2 st, vec3 position, vec4 texMatrix, vec4 offTurb)
st2.y = st.x * texMatrix.y + (st.y * texMatrix.w + offTurb.y);

vec2 offsetPos = vec2(position.x + position.z, position.y);

vec2 texOffset = sin(offsetPos * (2.0 * M_PI / 1024.0) + vec2(phase));
return st2 + texOffset * amplitude;

return st2 + texOffset * amplitude;
}
#endif

#if defined(USE_RGBAGEN)
vec4 CalcColor(vec3 position, vec3 normal)
{
vec4 color = u_VertColor * attr_Color + u_BaseColor;

if (u_ColorGen == CGEN_LIGHTING_DIFFUSE)
{
float incoming = clamp(dot(normal, u_ModelLightDir), 0.0, 1.0);
Expand Down Expand Up @@ -370,7 +370,7 @@ vec4 CalcColor(vec3 position, vec3 normal)
{
vec3 lightDir = normalize(vec3(-960.0, 1980.0, 96.0) - position);
vec3 reflected = -reflect(lightDir, normal);

color.a = clamp(dot(reflected, normalize(viewer)), 0.0, 1.0);
color.a *= color.a;
color.a *= color.a;
Expand All @@ -379,7 +379,7 @@ vec4 CalcColor(vec3 position, vec3 normal)
{
color.a = clamp(length(viewer) / u_PortalRange, 0.0, 1.0);
}

return color;
}
#endif
Expand Down Expand Up @@ -532,7 +532,7 @@ float CalcFog(in vec3 viewOrigin, in vec3 position, in Fog fog)

// fogPlane is inverted in tr_bsp for some reason.
float t = -(fog.plane.w + dot(viewOrigin, -fog.plane.xyz)) / dot(V, -fog.plane.xyz);

bool intersects = (t > 0.0 && t < 0.995);
if (inFog == intersects)
return 0.0;
Expand Down
66 changes: 33 additions & 33 deletions codemp/rd-rend2/glsl/lightall.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ vec2 ModTexCoords(vec2 st, vec3 position, vec4 texMatrix, vec4 offTurb)

vec2 texOffset = sin(offsetPos * (2.0 * M_PI / 1024.0) + vec2(phase));

return st2 + texOffset * amplitude;
return st2 + texOffset * amplitude;
}
#endif

Expand Down Expand Up @@ -462,26 +462,26 @@ float random( const vec2 p )
23.1406926327792690, // e^pi (Gelfond's constant)
2.6651441426902251); // 2^sqrt(2) (Gelfond-Schneider constant)
//return fract( cos( mod( 123456789., 1e-7 + 256. * dot(p,r) ) ) );
return mod( 123456789., 1e-7 + 256. * dot(p,r) );
return mod( 123456789., 1e-7 + 256. * dot(p,r) );
}

const vec2 poissonDisk[16] = vec2[16](
vec2( -0.94201624, -0.39906216 ),
vec2( 0.94558609, -0.76890725 ),
vec2( -0.094184101, -0.92938870 ),
vec2( 0.34495938, 0.29387760 ),
vec2( -0.91588581, 0.45771432 ),
vec2( -0.81544232, -0.87912464 ),
vec2( -0.38277543, 0.27676845 ),
vec2( 0.97484398, 0.75648379 ),
vec2( 0.44323325, -0.97511554 ),
vec2( 0.53742981, -0.47373420 ),
vec2( -0.26496911, -0.41893023 ),
vec2( 0.79197514, 0.19090188 ),
vec2( -0.24188840, 0.99706507 ),
vec2( -0.81409955, 0.91437590 ),
vec2( 0.19984126, 0.78641367 ),
vec2( 0.14383161, -0.14100790 )
const vec2 poissonDisk[16] = vec2[16](
vec2( -0.94201624, -0.39906216 ),
vec2( 0.94558609, -0.76890725 ),
vec2( -0.094184101, -0.92938870 ),
vec2( 0.34495938, 0.29387760 ),
vec2( -0.91588581, 0.45771432 ),
vec2( -0.81544232, -0.87912464 ),
vec2( -0.38277543, 0.27676845 ),
vec2( 0.97484398, 0.75648379 ),
vec2( 0.44323325, -0.97511554 ),
vec2( 0.53742981, -0.47373420 ),
vec2( -0.26496911, -0.41893023 ),
vec2( 0.79197514, 0.19090188 ),
vec2( -0.24188840, 0.99706507 ),
vec2( -0.81409955, 0.91437590 ),
vec2( 0.19984126, 0.78641367 ),
vec2( 0.14383161, -0.14100790 )
);

float PCF(const sampler2DArrayShadow shadowmap, const float layer, const vec2 st, const float dist, float PCFScale)
Expand Down Expand Up @@ -524,7 +524,7 @@ float PCF(const sampler2DArrayShadow shadowmap, const float layer, const vec2 st
}
mult *= 1.0 / 17.0;
#endif

return mult;
}

Expand Down Expand Up @@ -581,7 +581,7 @@ float sunShadow(in vec3 viewOrigin, in vec3 viewDir, in vec3 biasOffset)
}
}
}

return result;
}
#endif
Expand Down Expand Up @@ -610,10 +610,10 @@ float RayIntersectDisplaceMap(in vec2 inDp, in vec2 ds, in sampler2D normalMap,
for(int i = 0; i < linearSearchSteps - 1; ++i)
{
depth += size;

// height is flipped before uploaded to the gpu
float t = textureGrad(normalMap, dp + ds * depth, dx, dy).r;

if(depth >= t)
{
bestDepth = depth; // store best depth
Expand All @@ -627,10 +627,10 @@ float RayIntersectDisplaceMap(in vec2 inDp, in vec2 ds, in sampler2D normalMap,
for(int i = 0; i < binarySearchSteps; ++i)
{
size *= 0.5;

// height is flipped before uploaded to the gpu
float t = textureGrad(normalMap, dp + ds * depth, dx, dy).r;

if(depth >= t)
{
bestDepth = depth;
Expand Down Expand Up @@ -858,7 +858,7 @@ float pcfShadow(in sampler2DArrayShadow depthMap, in vec3 L, in float distance,
{
const int samples = 9;
const float diskRadius = M_PI / 512.0;

vec2 polarL = vec2(atan(L.z, L.x), acos(L.y));
float shadow = 0.0;

Expand Down Expand Up @@ -912,7 +912,7 @@ vec3 CalcDynamicLightContribution(
continue;
}
Light light = u_Lights[i];

vec3 L = light.origin.xyz - position;
float sqrLightDist = dot(L, L);

Expand Down Expand Up @@ -1066,7 +1066,7 @@ void main()
float shadowValue = sunShadow(u_ViewOrigin, viewDir, normalBias) * NPL;

// surfaces not facing the light are always shadowed

//shadowValue = mix(0.0, shadowValue, dot(N, primaryLightDir) > 0.0);

#if defined(SHADOWMAP_MODULATE)
Expand Down Expand Up @@ -1113,7 +1113,7 @@ void main()

specular.rgb = mix(vec3(0.08) * ORMS.w, diffuse.rgb, ORMS.z);
diffuse.rgb *= vec3(1.0 - ORMS.z);

roughness = mix(0.01, 1.0, ORMS.y);
AO = min(ORMS.x, AO);
#else
Expand Down Expand Up @@ -1148,7 +1148,7 @@ void main()

out_Color.rgb = lightColor * reflectance * (attenuation * NL);
out_Color.rgb += ambientColor * diffuse.rgb;

#if defined(USE_PRIMARY_LIGHT)
vec3 L2 = normalize(u_PrimaryLightOrigin.xyz);
vec3 H2 = normalize(L2 + E);
Expand All @@ -1166,18 +1166,18 @@ void main()

out_Color.rgb += lightColor * reflectance * NL2;
#endif

out_Color.rgb += CalcDynamicLightContribution(roughness, N, E, u_ViewOrigin, viewDir, NE, diffuse.rgb, specular.rgb, vertexNormal);
out_Color.rgb += CalcIBLContribution(roughness, N, E, u_ViewOrigin, viewDir, NE, specular.rgb * AO);
#else
lightColor = var_Color.rgb;
#if defined(USE_LIGHTMAP)
#if defined(USE_LIGHTMAP)
lightColor *= lightmapColor.rgb;
#endif

out_Color.rgb = diffuse.rgb * lightColor;
#endif

out_Color.a = diffuse.a;

#if defined(USE_GLOW_BUFFER)
Expand Down
Loading

0 comments on commit 0b92929

Please sign in to comment.