Use static samplers

This commit is contained in:
luboslenco
2025-04-19 12:29:49 +02:00
parent 639cae10e8
commit 35e52dbcb5
69 changed files with 262 additions and 1036 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
const my_texture: tex2d;
#[set(everything)]
const my_texture_sampler: sampler;
const sampler_linear: sampler;
#[set(everything)]
const constants: {
@@ -28,7 +28,7 @@ fun mesh_vert(input: vert_in): vert_out {
}
fun mesh_frag(input: vert_out): float4 {
return sample(my_texture, my_texture_sampler, input.tex);
return sample(my_texture, sampler_linear, input.tex);
}
#[pipe]
+2 -2
View File
@@ -3,7 +3,7 @@
const my_texture: tex2d;
#[set(everything)]
const my_texture_sampler: sampler;
const sampler_linear: sampler;
#[set(everything)]
const constants: {
@@ -33,7 +33,7 @@ fun mesh_vert(input: vert_in): vert_out {
fun mesh_frag(input: vert_out): float4 {
var l: float3 = float3(0.5, 0.0, 0.5);
var base_color: float3 = float3(1.0, 1.0, 1.0); // sample(my_texture, my_texture_sampler, input.tex).rgb;
var base_color: float3 = float3(1.0, 1.0, 1.0); // sample(my_texture, sampler_linear, input.tex).rgb;
var ambient: float3 = base_color * 0.5;
var n: float3 = normalize(input.nor);
var dotnl: float = max(dot(n, l), 0.0);