Skip to content

Commit

Permalink
Read control map as uint
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Oct 28, 2023
1 parent ecfde12 commit 6f8de9b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/shaders/main.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ uniform int _region_uv_limit = 8;
uniform int _region_map[256];
uniform vec2 _region_offsets[256];
uniform sampler2DArray _height_maps : repeat_disable;
uniform sampler2DArray _control_maps : repeat_disable;
uniform usampler2DArray _control_maps : repeat_disable;
uniform sampler2DArray _color_maps : source_color, repeat_disable;
uniform sampler2DArray _texture_array_albedo : source_color, filter_linear_mipmap_anisotropic, repeat_enable;
uniform sampler2DArray _texture_array_normal : hint_normal, filter_linear_mipmap_anisotropic, repeat_enable;
Expand Down Expand Up @@ -163,10 +163,10 @@ void fragment() {
ivec3 index10UV = get_region((pos_texel00 + mirror.zy) * _region_pixel_size);
ivec3 index11UV = get_region((pos_texel00 + mirror.zw) * _region_pixel_size);

uint control00 = floatBitsToUint(texelFetch(_control_maps, index00UV, 0).r);
uint control01 = floatBitsToUint(texelFetch(_control_maps, index01UV, 0).r);
uint control10 = floatBitsToUint(texelFetch(_control_maps, index10UV, 0).r);
uint control11 = floatBitsToUint(texelFetch(_control_maps, index11UV, 0).r);
uint control00 = texelFetch(_control_maps, index00UV, 0).r;
uint control01 = texelFetch(_control_maps, index01UV, 0).r;
uint control10 = texelFetch(_control_maps, index10UV, 0).r;
uint control11 = texelFetch(_control_maps, index11UV, 0).r;

vec2 weights1 = clamp(pos_texel - pos_texel00, 0, 1);
weights1 = mix(weights1, vec2(1.0) - weights1, mirror.xy);
Expand Down

0 comments on commit 6f8de9b

Please sign in to comment.