Browse Source

vulkan: Apply best practices for sampler modes

rdb 1 month ago
parent
commit
3102ddf3f4

+ 1 - 0
panda/src/pgraphnodes/lightLensNode.cxx

@@ -172,6 +172,7 @@ setup_shadow_map() {
   _shadow_map->set_clear_color(LColor(1));
   _shadow_map->set_clear_color(LColor(1));
   _shadow_map->set_wrap_u(SamplerState::WM_border_color);
   _shadow_map->set_wrap_u(SamplerState::WM_border_color);
   _shadow_map->set_wrap_v(SamplerState::WM_border_color);
   _shadow_map->set_wrap_v(SamplerState::WM_border_color);
+  _shadow_map->set_wrap_w(SamplerState::WM_border_color);
   _shadow_map->set_border_color(LColor(1));
   _shadow_map->set_border_color(LColor(1));
   _shadow_map->set_minfilter(SamplerState::FT_shadow);
   _shadow_map->set_minfilter(SamplerState::FT_shadow);
   _shadow_map->set_magfilter(SamplerState::FT_shadow);
   _shadow_map->set_magfilter(SamplerState::FT_shadow);

+ 1 - 0
panda/src/pgraphnodes/pointLight.cxx

@@ -208,6 +208,7 @@ setup_shadow_map() {
   _shadow_map->set_clear_color(LColor(1));
   _shadow_map->set_clear_color(LColor(1));
   _shadow_map->set_wrap_u(SamplerState::WM_clamp);
   _shadow_map->set_wrap_u(SamplerState::WM_clamp);
   _shadow_map->set_wrap_v(SamplerState::WM_clamp);
   _shadow_map->set_wrap_v(SamplerState::WM_clamp);
+  _shadow_map->set_wrap_w(SamplerState::WM_clamp);
   _shadow_map->set_minfilter(SamplerState::FT_shadow);
   _shadow_map->set_minfilter(SamplerState::FT_shadow);
   _shadow_map->set_magfilter(SamplerState::FT_shadow);
   _shadow_map->set_magfilter(SamplerState::FT_shadow);
 }
 }

+ 1 - 0
panda/src/pgraphnodes/spotlight.cxx

@@ -181,6 +181,7 @@ make_spot(int pixel_width, PN_stdfloat full_radius, LColor &fg, LColor &bg) {
   tex->set_border_color(bg);
   tex->set_border_color(bg);
   tex->set_wrap_u(SamplerState::WM_border_color);
   tex->set_wrap_u(SamplerState::WM_border_color);
   tex->set_wrap_v(SamplerState::WM_border_color);
   tex->set_wrap_v(SamplerState::WM_border_color);
+  tex->set_wrap_w(SamplerState::WM_border_color);
 
 
   tex->set_minfilter(SamplerState::FT_linear);
   tex->set_minfilter(SamplerState::FT_linear);
   tex->set_magfilter(SamplerState::FT_linear);
   tex->set_magfilter(SamplerState::FT_linear);

+ 1 - 0
panda/src/text/dynamicTextPage.cxx

@@ -55,6 +55,7 @@ DynamicTextPage(DynamicTextFont *font, int page_number) :
   // edges at all.
   // edges at all.
   set_wrap_u(text_wrap_mode);
   set_wrap_u(text_wrap_mode);
   set_wrap_v(text_wrap_mode);
   set_wrap_v(text_wrap_mode);
+  set_wrap_w(text_wrap_mode);
   set_border_color(font->get_bg());
   set_border_color(font->get_bg());
 
 
   // Fill the page with the font's background color.
   // Fill the page with the font's background color.

+ 1 - 1
panda/src/vulkandisplay/vulkanGraphicsStateGuardian.cxx

@@ -497,7 +497,7 @@ reset() {
     sampler_info.compareEnable = VK_TRUE;
     sampler_info.compareEnable = VK_TRUE;
     sampler_info.compareOp = VK_COMPARE_OP_LESS_OR_EQUAL;
     sampler_info.compareOp = VK_COMPARE_OP_LESS_OR_EQUAL;
     sampler_info.minLod = 0;
     sampler_info.minLod = 0;
-    sampler_info.maxLod = 0.25;
+    sampler_info.maxLod = VK_LOD_CLAMP_NONE;
     sampler_info.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
     sampler_info.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
     sampler_info.unnormalizedCoordinates = VK_FALSE;
     sampler_info.unnormalizedCoordinates = VK_FALSE;