Difference between revisions of "$PointSampleMagFilter"

From Valve Developer Community
Jump to: navigation, search
(added VTF PS blend compatibility, syntax sample, unstubbed)
(more info and image to illustrate)
 
Line 1: Line 1:
[[File:$pointsamplemagfilter.png|thumb|Example of $pointsamplemagfilter set to 1 and 0.]]
+
[[File:$pointsamplemagfilter.png|thumb|right|Example of $pointsamplemagfilter set to 1 and 0.]]
 +
 
 +
{{Shaderparam|$pointsamplemagfilter|shader1=LightmappedGeneric|game=Counter-Strike: Global Offensive}} It disables texture filtering on a material if the texture resolution is bigger than the space it occupies onscreen, and linearly interpolated (smooth) if its smaller, and will use mipmaps.
 +
 
 +
This makes it pixelated when near the texture, but smooth when far way, and will not produce [https://en.wikipedia.org/wiki/Moir%C3%A9_pattern moiré patterns] when viewed at grazing angles or from distance, compared to just enabling Point Sampling flag in a material's [[VTF]].
 +
 
  
{{Shaderparam|$pointsamplemagfilter|shader1=LightmappedGeneric|game=Counter-Strike: Global Offensive}} It disables texture filtering on a material, leading to a pixelated look.
 
 
{{note|Not compatible with blended displacement materials.}}
 
{{note|Not compatible with blended displacement materials.}}
 
{{note|A similar effect can be achieved by enabling Point Sampling in a material's [[VTF]] file. ( Which <i>does</i> work with blended materials, use this instead! )}}
 
{{note|A similar effect can be achieved by enabling Point Sampling in a material's [[VTF]] file. ( Which <i>does</i> work with blended materials, use this instead! )}}
 
{{bug|This parameter may not work on older hardware.}}
 
{{bug|This parameter may not work on older hardware.}}
 +
 +
 +
 +
 +
[[File:Difference.png|thumb|center|720px|Difference side by side, $pointsamplemagfilter (left) is pixelated and looks good in the distance as well]]
 +
 +
  
 
== VMT syntax example ==
 
== VMT syntax example ==

Latest revision as of 15:09, 6 March 2020

Example of $pointsamplemagfilter set to 1 and 0.

$pointsamplemagfilter is a material shader parameter available in <Counter-Strike: Global Offensive> Counter-Strike: Global Offensive for LightmappedGeneric. It disables texture filtering on a material if the texture resolution is bigger than the space it occupies onscreen, and linearly interpolated (smooth) if its smaller, and will use mipmaps.

This makes it pixelated when near the texture, but smooth when far way, and will not produce moiré patterns when viewed at grazing angles or from distance, compared to just enabling Point Sampling flag in a material's VTF.


Note:Not compatible with blended displacement materials.
Note:A similar effect can be achieved by enabling Point Sampling in a material's VTF file. ( Which does work with blended materials, use this instead! )
Bug: This parameter may not work on older hardware.



Difference side by side, $pointsamplemagfilter (left) is pixelated and looks good in the distance as well


VMT syntax example

$pointsamplemagfilter <bool>