Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Use GLES3 for rendering #2396

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dat/bkg/haze.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const float SCALE = 1.0/900.0;
const float TIME_SCALE = 1.0/50.0;
const float VISIBILITY = 700.0;

uniform float u_time = 0.0;
uniform float u_time;
uniform vec3 u_camera;

vec4 effect( vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords )
Expand Down
2 changes: 1 addition & 1 deletion dat/bkg/pso.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const float SCALE = 1.0/300.0;
const float TIME_SCALE = 1.0/50.0;
const float nonuniformity = %f;

uniform float u_time = 0.0;
uniform float u_time;
uniform vec3 u_camera;

vec4 effect( vec4 colour, Image tex, vec2 texture_coords, vec2 screen_coords )
Expand Down
4 changes: 2 additions & 2 deletions dat/bkg/shaders/blackhole.frag
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const mat3 R = Rx * Ry * Rz; /**< Final camera rotation matrix. */
const mat3 Rinv = Rinvz * Rinvy * Rinvx;

/* Uniforms. Most is hardcoded. */
uniform float u_time = 0.0;
uniform vec3 u_camera= vec3( 0.0, 0.0, 1.0 );
uniform float u_time;
uniform vec3 u_camera;
uniform sampler2D u_bgtex;

/* Value Noise. */
Expand Down
4 changes: 2 additions & 2 deletions dat/bkg/shaders/ionicstorm.frag
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "lib/simplex.glsl"

uniform float u_time = 0.0;
uniform vec3 u_camera = vec3(1.0); /* xy corresponds to screen space */
uniform float u_time;
uniform vec3 u_camera; /* xy corresponds to screen space */

const vec3 COL_BACK = vec3( 0.35, 0.3, 1.0 );
const vec3 COL_FRONT = vec3( 1.5, 0.65, 0.9 );
Expand Down
2 changes: 1 addition & 1 deletion dat/bkg/shaders/plasmastorm.frag
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "lib/colour.glsl"

uniform float u_time;
uniform vec3 u_camera = vec3(1.0); /* xy corresponds to screen space */
uniform vec3 u_camera; /* xy corresponds to screen space */

const float DRAGMULT = 10.0;
const float SCALE = 300.0;
Expand Down
2 changes: 1 addition & 1 deletion dat/bkg/shaders/starfield.frag
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#define MOTIONBLUR %d

uniform vec4 u_camera = vec4(1.0); /* xy corresponds to screen space */
uniform vec4 u_camera; /* xy corresponds to screen space */
#if MOTIONBLUR==1
uniform sampler2D u_prevtex;
#endif /* MOTIONBLUR==1 */
Expand Down
4 changes: 2 additions & 2 deletions dat/events/chapter1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function cutscene_main4 ()
local pixelcode_fadein = [[
#include "lib/sdf.glsl"

uniform float u_progress = 0.0;
uniform float u_progress;

vec4 effect( sampler2D tex, vec2 texture_coords, vec2 screen_coords )
{
Expand All @@ -390,7 +390,7 @@ vec4 effect( sampler2D tex, vec2 texture_coords, vec2 screen_coords )

const float INTENSITY = 10.0;

uniform float u_progress = 0.0;
uniform float u_progress;

vec4 effect( sampler2D tex, vec2 texture_coords, vec2 screen_coords )
{
Expand Down
2 changes: 1 addition & 1 deletion dat/events/sirius/eye_of_night_mystery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ What do you do?]])

const float INTENSITY = 10.0;

uniform float u_progress = 0.0;
uniform float u_progress;

vec4 effect( sampler2D tex, vec2 texture_coords, vec2 screen_coords )
{
Expand Down
8 changes: 4 additions & 4 deletions dat/glsl/chakra_exp.frag
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "lib/sdf.glsl"
#include "lib/simplex.glsl"

uniform float u_time = 0.0;
uniform float u_speed = 1.0;
uniform float u_grain = 1.0;
uniform float u_r = 0.0;
uniform float u_time;
uniform float u_speed;
uniform float u_grain;
uniform float u_r;

vec4 effect( vec4 color, sampler2D tex, vec2 texture_coords, vec2 screen_coords )
{
Expand Down
8 changes: 4 additions & 4 deletions dat/glsl/cleansing_flames.frag
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "lib/sdf.glsl"
#include "lib/simplex.glsl"

uniform float u_time = 0.0;
uniform float u_speed = 1.0;
uniform float u_grain = 1.0;
uniform float u_r = 0.0;
uniform float u_time;
uniform float u_speed;
uniform float u_grain;
uniform float u_r;

vec4 effect( vec4 color, sampler2D tex, vec2 texture_coords, vec2 screen_coords )
{
Expand Down
4 changes: 2 additions & 2 deletions dat/glsl/damage.frag
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ in vec4 VaryingTexCoord;
out vec4 color_out;

uniform vec4 love_ScreenSize;
uniform float damage_strength = 0.0; /**< 0 to 1 value where 1 indicates a ton of damage. */
uniform float u_time = 0.0; /**< Constantly increasing timer value. */
uniform float damage_strength; /**< 0 to 1 value where 1 indicates a ton of damage. */
uniform float u_time; /**< Constantly increasing timer value. */

const float OFFSET_MOD = 13.0; /**< How many pixels to multiply by. */
const float OFFSET_MAX = 5.0; /**< Maximum offset in pixels. */
Expand Down
6 changes: 3 additions & 3 deletions dat/glsl/effects/antimatter_taint.frag
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_r;
uniform float u_timer;
uniform float u_elapsed;

const float FADE = 0.3;

Expand Down
6 changes: 3 additions & 3 deletions dat/glsl/effects/astral_projection.frag
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_r;
//uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_dir = 0.0;
uniform float u_elapsed;
uniform float u_dir;

const vec4 COLOUR_OUTLINE = vec4( 0.9, 0.9, 0.4, 3.0/3.0 );
const vec4 COLOUR_BRIGHT = vec4( 0.6, 0.6, 0.3, 2.0/3.0 );
Expand Down
6 changes: 3 additions & 3 deletions dat/glsl/effects/avatar_of_sirichana.frag
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_r;
uniform float u_timer;
uniform float u_elapsed;

in vec2 tex_coord;
out vec4 colour_out;
Expand Down
4 changes: 2 additions & 2 deletions dat/glsl/effects/blink.frag
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ uniform vec3 dimensions;
uniform sampler2D u_tex;

//uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_timer;
uniform float u_elapsed;

const float LENGTH = 0.3;
const vec3 FADECOL = vec3( 0.6, 0.6, 1.0 );
Expand Down
8 changes: 4 additions & 4 deletions dat/glsl/effects/chakra_corruption.frag
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_dir = 0.0;
uniform float u_r;
uniform float u_timer;
uniform float u_elapsed;
uniform float u_dir;

const float FADE = 0.3;
const vec4 COLOUR = vec4( 1.0, 0.8, 0.0, 1.0 );
Expand Down
4 changes: 2 additions & 2 deletions dat/glsl/effects/ethereal.frag
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_r;
//uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_elapsed;

in vec2 tex_coord;
out vec4 colour_out;
Expand Down
4 changes: 2 additions & 2 deletions dat/glsl/effects/fadein.frag
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "lib/simplex.glsl"
uniform sampler2D u_tex;

uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_timer;
uniform float u_elapsed;

const float LENGTH = 3.0;

Expand Down
4 changes: 2 additions & 2 deletions dat/glsl/effects/fadeout.frag
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "lib/simplex.glsl"
uniform sampler2D u_tex;

uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_timer;
uniform float u_elapsed;

const float LENGTH = 3.0;

Expand Down
4 changes: 2 additions & 2 deletions dat/glsl/effects/feather_drive.frag
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ uniform vec3 dimensions;
uniform sampler2D u_tex;

//uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_timer;
uniform float u_elapsed;

const float LENGTH = 0.3;
const vec3 FADECOL = vec3( 1.0, 0.8, 0.0 );
Expand Down
4 changes: 2 additions & 2 deletions dat/glsl/effects/fractured_reality.frag
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_timer;
uniform float u_elapsed;

in vec2 tex_coord;
out vec4 colour_out;
Expand Down
6 changes: 3 additions & 3 deletions dat/glsl/effects/psychic_orb_off.frag
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_r;
//uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_dir = 0.0;
uniform float u_elapsed;
uniform float u_dir;

in vec2 tex_coord;
in vec2 tex_scale;
Expand Down
8 changes: 4 additions & 4 deletions dat/glsl/effects/psychic_orb_on.frag
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
//uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_dir = 0.0;
uniform float u_r;
//uniform float u_timer;
uniform float u_elapsed;
uniform float u_dir;

in vec2 tex_coord;
in vec2 tex_scale;
Expand Down
6 changes: 3 additions & 3 deletions dat/glsl/effects/shared/hypergate.frag
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_r;
uniform float u_timer;
uniform float u_elapsed;

const float TIME_TOTAL = 3.0;
const float AMPLITUDE = 30.0;
Expand Down
6 changes: 3 additions & 3 deletions dat/glsl/effects/shared/plasma_burn_base.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_r;
uniform float u_timer;
uniform float u_elapsed;

const float FADE = 0.3;

Expand Down
6 changes: 3 additions & 3 deletions dat/glsl/effects/shared/wormhole.frag
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ u_elapsed or u_timer and include this file. */
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_r;
uniform float u_timer;
uniform float u_elapsed;

const float TIME_GLOW = 1.1;
const float TIME_TOTAL = 3.0;
Expand Down
6 changes: 3 additions & 3 deletions dat/glsl/effects/shieldboost.frag
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
uniform vec3 dimensions;
uniform sampler2D u_tex;

uniform float u_r = 0.0;
uniform float u_timer = 0.0;
uniform float u_elapsed = 0.0;
uniform float u_r;
uniform float u_timer;
uniform float u_elapsed;

in vec2 tex_coord;
out vec4 colour_out;
Expand Down
12 changes: 6 additions & 6 deletions dat/glsl/emp.frag
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#include "lib/simplex.glsl"

/* Common uniforms for special effects. */
uniform float u_time = 0.0; /**< Elapsed time. */
uniform float u_r = 0.0; /**< Random seed. */
uniform float u_time ; /**< Elapsed time. */
uniform float u_r ; /**< Random seed. */
/* Custom stuff. */
uniform float u_speed = 1.3; /**< How fast it playes. */
uniform float u_grain = 1.0; /**< How grainy it is. */
uniform float u_speed ; /**< How fast it playes. */
uniform float u_grain ; /**< How grainy it is. */

const float UP = 0.7; /**< Time spent on creating the explosion vs not doing it. */
const float MAX = 0.65;/**< How big the effect can get. */
const float UP ; /**< Time spent on creating the explosion vs not doing it. */
const float MAX ;/**< How big the effect can get. */

/* Entry point. */
vec4 effect( vec4 colour, Image tex, vec2 texture_coords, vec2 screen_coords )
Expand Down
8 changes: 4 additions & 4 deletions dat/glsl/emp_blast.frag
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "lib/sdf.glsl"
#include "lib/simplex.glsl"

uniform float u_time = 0.0;
uniform float u_speed = 1.0;
uniform float u_grain = 1.0;
uniform float u_r = 0.0;
uniform float u_time;
uniform float u_speed;
uniform float u_grain;
uniform float u_r;

vec4 effect( vec4 color, sampler2D tex, vec2 texture_coords, vec2 screen_coords )
{
Expand Down
22 changes: 11 additions & 11 deletions dat/glsl/explosion.frag
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include "lib/gamma.glsl"

/* Common uniforms for special effects. */
uniform float u_time = 0.0; /**< Elapsed time. */
uniform float u_r = 0.0; /**< Random seed. */
uniform float u_time; /**< Elapsed time. */
uniform float u_r; /**< Random seed. */

/* Main constants. */
const float CAM_DIST = 2.0; /**< Distance of the camera from the origin. Defaults to 2.0. */
Expand All @@ -21,15 +21,15 @@ const float BRIGHTNESS_RADIUS_OFFSET = 1.3;/**< Determines the radius-dependent
const float CONTRAST = 1.0; /**< Final colour contrast. Higher values correspond to less contrast. Defaults 1.0. */

/* Uniforms. */
uniform float u_smokiness = 0.588; /**< Lower value saturates the explosion, while higher values give it a smokey look. Default to 0.588. */
uniform float u_grain = 0.5; /**< Determines the details of the explosions. Increasing it likely requires increasing step size. Defaults to 0.5. */
uniform float u_speed = 0.4; /**< How fast the animation plays. Total play time is 1.0/u_speed. */
uniform vec4 u_colorbase = vec4( 1.2, 0.9, 0.5, 0.7); /**< Base colour of the explosion. Defaults to {1.2, 0.9, 0.5, 0.7}. */
uniform vec4 u_colorsmoke = vec4( 0.15, 0.15, 0.15, 0.1); /**< Colour to use for the smoke, most likely shouldn't be changed. Defaults to {0.15, 0.15, 0.15, 0.1}. */
uniform int u_steps = 16; /**< How many steps to march. Defaults to 16. */
uniform float u_roll_speed = 1.0; /**< How fast the sphere cloud effects roll. Defaults to 1.0. */
uniform float u_roll_dampening = 0.7; /**< How fast the sphere cloud effects roll gets dampened. Defaults to 0.7. */
uniform float u_smoke_fade = 1.4; /**< Determines how the smake fades. Larger values leave more smoke at the end. Defaults to 1.4. */
uniform float u_smokiness; /**< Lower value saturates the explosion, while higher values give it a smokey look. Default to 0.588. */
uniform float u_grain; /**< Determines the details of the explosions. Increasing it likely requires increasing step size. Defaults to 0.5. */
uniform float u_speed; /**< How fast the animation plays. Total play time is 1.0/u_speed. */
uniform vec4 u_colorbase; /**< Base colour of the explosion. Defaults to {1.2, 0.9, 0.5, 0.7}. */
uniform vec4 u_colorsmoke; /**< Colour to use for the smoke, most likely shouldn't be changed. Defaults to {0.15, 0.15, 0.15, 0.1}. */
uniform int u_steps; /**< How many steps to march. Defaults to 16. */
uniform float u_roll_speed; /**< How fast the sphere cloud effects roll. Defaults to 1.0. */
uniform float u_roll_dampening; /**< How fast the sphere cloud effects roll gets dampened. Defaults to 0.7. */
uniform float u_smoke_fade; /**< Determines how the smake fades. Larger values leave more smoke at the end. Defaults to 1.4. */

/* Noise function to use. Has to be in the [0,1] range. */
float noise( vec3 x )
Expand Down
Loading