added curvature strength slider and restructured world module

This commit is contained in:
Valerie Wolfe 2024-04-18 16:23:06 -04:00
parent 038ff7f142
commit 8da7185ead
4 changed files with 24 additions and 12 deletions

View file

@ -2,8 +2,6 @@
#include "/module/common.glsl" #include "/module/common.glsl"
#define worldCurvature 0 // [0 1 2]
varying vec2 texcoord; varying vec2 texcoord;
varying vec4 color; varying vec4 color;
varying vec2 lmcoord; varying vec2 lmcoord;
@ -13,6 +11,7 @@ uniform float viewWidth, viewHeight;
#include "/module/vertex_warp.vert" #include "/module/vertex_warp.vert"
#include "/module/texture_warp.vert" #include "/module/texture_warp.vert"
#include "/module/world.vert"
void main() { void main() {
texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
@ -30,7 +29,9 @@ void main() {
#endif #endif
#ifndef NON_WORLD #ifndef NON_WORLD
#include "/module/world.vert" #if worldCurvature > 0
world_curvature();
#endif
#endif #endif
} }

View file

@ -56,4 +56,9 @@ option.worldCurvature=World Curvature
value.worldCurvature.0=Off value.worldCurvature.0=Off
value.worldCurvature.1=Cylinder value.worldCurvature.1=Cylinder
value.worldCurvature.2=Round value.worldCurvature.2=Round
option.worldRadius=Curvature Strength
value.worldRadius.1024=Low (1024)
value.worldRadius.512=Medium (512)
value.worldRadius.256=High (256)
value.worldRadius.-256=Inverse (-256)

View file

@ -1,8 +1,14 @@
#if worldCurvature == 1
float z = gl_Position.z * gl_Position.z; #define worldCurvature 0 // [0 1 2]
gl_Position.y -= z / 256; #define worldRadius 512 // [1024 512 256 -256]
#elif worldCurvature == 2
vec2 xz = gl_Position.xz; void world_curvature() {
gl_Position.y -= ceil(( dot(xz, xz) * 5 ) / 512) / 5; #if worldCurvature == 1
#endif float z = gl_Position.z * gl_Position.z;
gl_Position.y -= 2 * z / worldRadius;
#elif worldCurvature == 2
vec2 xz = gl_Position.xz;
gl_Position.y -= ceil(( dot(xz, xz) * 5 ) / worldRadius) / 5;
#endif
}

View file

@ -1,4 +1,4 @@
sliders=pixelSize hueSteps satSteps valSteps rgbSteps vWarp sliders=pixelSize hueSteps satSteps valSteps rgbSteps vWarp worldRadius
# -- PROFILES -- # -- PROFILES --
profile.DEFAULT=pixelSize=2 colorMode=0 dithering hueSteps=4 satSteps=4 valSteps=4 vWarp=0 !tWarp !hBlur profile.DEFAULT=pixelSize=2 colorMode=0 dithering hueSteps=4 satSteps=4 valSteps=4 vWarp=0 !tWarp !hBlur
@ -26,7 +26,7 @@ screen.PSX=vWarp tWarp # playstation
screen.REALITY=hBlur # nintendo 64 screen.REALITY=hBlur # nintendo 64
# custom effects # custom effects
screen.FX=dof dofRes worldCurvature screen.FX=dof dofRes worldCurvature worldRadius
# -- CONDITIONALS -- # -- CONDITIONALS --
gbuffers_hand.enabled=tWarp gbuffers_hand.enabled=tWarp