Skip to content

Commit

Permalink
fix sdf sample for wgpu (shader used a reserved keyword)
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Aug 28, 2023
1 parent 4f6b689 commit 480c261
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
28 changes: 14 additions & 14 deletions sapp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,20 @@ fips_end_app()
# fips_deps(sokol)
#fips_end_app()
#
#fips_ide_group(Samples)
#fips_begin_app(sdf-sapp windowed)
# fips_files(sdf-sapp.c)
# sokol_shader(sdf-sapp.glsl ${slang})
# fips_deps(sokol)
#fips_end_app()
#fips_ide_group(SamplesWithDebugUI)
#fips_begin_app(sdf-sapp-ui windowed)
# fips_files(sdf-sapp.c)
# sokol_shader(sdf-sapp.glsl ${slang})
# fips_deps(sokol dbgui)
# target_compile_definitions(sdf-sapp-ui PRIVATE USE_DBG_UI)
#fips_end_app()
#
fips_ide_group(Samples)
fips_begin_app(sdf-sapp windowed)
fips_files(sdf-sapp.c)
sokol_shader(sdf-sapp.glsl ${slang})
fips_deps(sokol)
fips_end_app()
fips_ide_group(SamplesWithDebugUI)
fips_begin_app(sdf-sapp-ui windowed)
fips_files(sdf-sapp.c)
sokol_shader(sdf-sapp.glsl ${slang})
fips_deps(sokol dbgui)
target_compile_definitions(sdf-sapp-ui PRIVATE USE_DBG_UI)
fips_end_app()

#fips_ide_group(Samples)
#fips_begin_app(shapes-sapp windowed)
# fips_files(shapes-sapp.c)
Expand Down
2 changes: 0 additions & 2 deletions sapp/sdf-sapp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ vec3 calc_color(vec3 ro, vec3 rd, float t, vec4 tra) {
vec3 pos = ro + rd * t;
vec3 nrm = surface_normal(pos, t);
vec3 hal = normalize(light1 - rd);
vec3 ref = reflect(rd, nrm);
float occ = clamp(0.05 * log(tra.x), 0.0, 1.0);
float fac = clamp(1.0 + dot(rd, nrm), 0.0, 1.0);

Expand Down Expand Up @@ -183,4 +182,3 @@ void main() {
@end

@program sdf vs fs

0 comments on commit 480c261

Please sign in to comment.