Skip to content

Commit

Permalink
shaders: Edit blender scripts to use OpenGL samplers.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Dec 2, 2015
1 parent 635f365 commit e6798d5
Show file tree
Hide file tree
Showing 57 changed files with 166 additions and 517 deletions.
16 changes: 3 additions & 13 deletions res/gamedata/shaders/gl/accum_volumetric.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
-- : aref (true,0)
: sorting (2, false)
-- TODO: Implement sampler states
-- shader:sampler ("s_lmap") :texture (t_base): clamp()
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_noise") :texture("fx\\fx_noise") : f_linear ()

shader:dx10texture ("s_lmap", t_base)
shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_noise", "fx\\fx_noise")

shader:dx10sampler ("smp_rtlinear")
shader:dx10sampler ("smp_linear")
-- shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_lmap") :texture (t_base): clamp()
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_noise") :texture ("fx\\fx_noise") : f_linear ()
end
16 changes: 3 additions & 13 deletions res/gamedata/shaders/gl/accum_volumetric_nomsaa.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
-- : aref (true,0)
: sorting (2, false)
-- TODO: Implement sampler states
-- shader:sampler ("s_lmap") :texture (t_base): clamp()
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_noise") :texture("fx\\fx_noise") : f_linear ()

shader:dx10texture ("s_lmap", t_base)
shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_noise", "fx\\fx_noise")

shader:dx10sampler ("smp_rtlinear")
shader:dx10sampler ("smp_linear")
-- shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_lmap") :texture (t_base): clamp()
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_noise") :texture ("fx\\fx_noise") : f_linear ()
end
16 changes: 3 additions & 13 deletions res/gamedata/shaders/gl/accum_volumetric_sun.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_smap_minmax", "$user$smap_depth_minmax");
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
16 changes: 3 additions & 13 deletions res/gamedata/shaders/gl/accum_volumetric_sun_minmax.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_smap_minmax", "$user$smap_depth_minmax");
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa0.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa1.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa2.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa3.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa4.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa5.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa6.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa7.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
17 changes: 4 additions & 13 deletions res/gamedata/shaders/gl/accum_volumetric_sun_nomsaa.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,8 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_smap_minmax", "$user$smap_depth_minmax");
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_smap_minmax") :texture ("$user$smap_depth_minmax") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
17 changes: 4 additions & 13 deletions res/gamedata/shaders/gl/accum_volumetric_sun_nomsaa_minmax.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,8 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_smap_minmax", "$user$smap_depth_minmax");
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_smap_minmax") :texture ("$user$smap_depth_minmax") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
15 changes: 3 additions & 12 deletions res/gamedata/shaders/gl/clouds.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@ function normal (shader, t_base, t_second, t_detail)
: zb (false,false)
: sorting (3, true)
: blend (true, blend.srcalpha,blend.invsrcalpha)

-- TODO: DX10: implement sampler setup
-- shader:sampler ("s_clouds0") :texture ("null") : wrap() : f_anisotropic()
-- shader:sampler ("s_clouds1") :texture ("null") : wrap() : f_anisotropic()
-- shader:sampler ("s_tonemap") :texture ("$user$tonemap")

shader:dx10texture ("s_clouds0", "null")
shader:dx10texture ("s_clouds1", "null")
shader:dx10texture ("s_tonemap", "$user$tonemap")

shader:dx10sampler ("smp_base")
-- shader:dx10sampler ("smp_linear")
shader:sampler ("s_clouds0") :texture ("null") : wrap() : f_anisotropic()
shader:sampler ("s_clouds1") :texture ("null") : wrap() : f_anisotropic()
shader:sampler ("s_tonemap") :texture ("$user$tonemap")
end
10 changes: 2 additions & 8 deletions res/gamedata/shaders/gl/combine_volumetric.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
-- : aref (true,0) -- enable to save bandwith?
: sorting (2, false)
-- TOD0: DX10: Implement samplers
-- shader:sampler ("s_vollight") :texture ("$user$generic2")
-- shader:sampler ("s_tonemap") :texture ("$user$tonemap")

shader:dx10texture ("s_vollight", "$user$generic2")
shader:dx10texture ("s_tonemap", "$user$tonemap")

shader:dx10sampler ("smp_nofilter")
shader:sampler ("s_vollight") :texture ("$user$generic2")
shader:sampler ("s_tonemap") :texture ("$user$tonemap")
end
16 changes: 4 additions & 12 deletions res/gamedata/shaders/gl/details_lod.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ function pass_setup_common (shader, t_base, t_second, t_detail)
stencil_op.keep, stencil_op.replace, stencil_op.keep)
:dx10stencil_ref (1)

shader:dx10texture ("s_base", t_base)
shader:dx10texture ("s_hemi", t_base .. "_nm")

shader:dx10sampler ("smp_base");
shader:dx10sampler ("smp_linear");
shader:sampler ("s_base") :texture (t_base)
shader:sampler ("s_hemi") :texture (t_base .. "_nm")
end

function l_special (shader, t_base, t_second, t_detail)
Expand Down Expand Up @@ -48,12 +45,7 @@ function l_special (shader, t_base, t_second, t_detail)
stencil_op.keep, stencil_op.replace, stencil_op.keep)

shader:dx10stencil_ref (1)
-- shader:sampler ("s_base") :texture (t_base)
-- shader:sampler ("s_hemi") :texture (t_base .. "_nm")
shader:dx10texture ("s_base", t_base)
shader:dx10texture ("s_hemi", t_base .. "_nm")

shader:dx10sampler ("smp_base");
shader:dx10sampler ("smp_linear");
shader:sampler ("s_base") :texture (t_base)
shader:sampler ("s_hemi") :texture (t_base .. "_nm")
end
]]--
10 changes: 2 additions & 8 deletions res/gamedata/shaders/gl/distort.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ function normal (shader, t_base, t_second, t_detail)
shader:begin ("stub_notransform_t","distort")
: fog (false)
: zb (false,false)
-- TODO: DX10: Implement samplers
-- shader:sampler ("s_base") :texture("$user$generic0") : clamp() : f_linear ()
-- shader:sampler ("s_distort") :texture("$user$generic1") : clamp() : f_linear ()

shader:dx10texture ("s_base", "$user$generic0")
shader:dx10texture ("s_distort", "$user$generic1")

shader:dx10sampler ("smp_rtlinear");
shader:sampler ("s_base") :texture("$user$generic0") : clamp() : f_linear ()
shader:sampler ("s_distort") :texture("$user$generic1") : clamp() : f_linear ()
end
7 changes: 1 addition & 6 deletions res/gamedata/shaders/gl/effects_bullet_tracer.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@ function normal (shader, t_base, t_second, t_detail)
:blend(true, blend.one, blend.one)
-- :blend(true, blend.srcalpha, blend.one)
-- :aref(true, 32)

-- Decouple sampler and texture
-- shader:sampler ("s_base") : texture(t_base) : clamp() : f_linear ()
-- TODO: DX10: move stub_default to smp_rtlinear
shader:dx10texture ("s_base", t_base)
shader:dx10sampler ("smp_base")
shader:sampler ("s_base") : texture(t_base) : clamp() : f_linear ()
end
Loading

0 comments on commit e6798d5

Please sign in to comment.