Skip to content

Commit

Permalink
use textureSize() in shadows-sapp.glsl instead passing from cpu side
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Jul 3, 2023
1 parent cd180e6 commit 616465b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion sapp/shadows-sapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ void frame(void) {
const fs_display_params_t fs_display_params = {
.light_dir = HMM_NormalizeVec3(light_pos.XYZ),
.eye_pos = eye_pos,
.sm_size = HMM_Vec2(2048.0f, 2048.0f),
};

const vs_display_params_t plane_vs_display_params = {
Expand Down
2 changes: 1 addition & 1 deletion sapp/shadows-sapp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ void main() {
uniform fs_display_params {
vec3 light_dir;
vec3 eye_pos;
vec2 sm_size;
};

uniform texture2D shadow_map;
Expand All @@ -124,6 +123,7 @@ vec4 gamma(vec4 c) {
}

void main() {
vec2 sm_size = textureSize(sampler2D(shadow_map, shadow_sampler), 0);
float spec_power = 2.2;
float ambient_intensity = 0.25;
vec3 l = normalize(light_dir);
Expand Down

0 comments on commit 616465b

Please sign in to comment.