$pointsamplemagfilter: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(Add Strata Source)
 
(15 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{lang|$PointSampleMagFilter|title=<code>$pointsamplemagfilter</code>}}
{{LanguageBar|title = <code>$pointsamplemagfilter</code>}}
[[File:$pointsamplemagfilter.png|thumb|right|Example of $pointsamplemagfilter set to 1 and 0.]]


'''$pointsamplemagfilter''' is a [[material]] [[shader]] parameter available in {{csgo}} [[Counter-Strike: Global Offensive]] for <code>[[LightmappedGeneric]]</code>. 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 [[MIP_Mapping|mipmaps]].


[[File:$pointsamplemagfilter.png|thumb|right|Example of '''$pointsamplemagfilter''' set to 1 and 0.]]


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 [[Valve_Texture_Format|VTF]].
'''$pointsamplemagfilter''' is a [[material]] [[shader]] parameter available in {{csgo|4}}, {{strata|4}}, {{mcv|4}}, and {{jbep3|4}} for <code>[[LightmappedGeneric]]</code>. 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 [[MIP_Mapping|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, unlike just enabling Point Sampling flag in a material's [[Valve_Texture_Format|VTF]].
{{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 [[Valve_Texture_Format|VTF]] file. ( Which ''does'' work with blended materials, use this instead! )}}
{{Note|A similar effect can be achieved by enabling Point Sampling in a texture's [[Valve_Texture_Format|VTF]] file (which works on all materials).}}
{{Note|Effect only works on <code>[[$basetexture]]</code> and will not have the desired effect on the <code>[[$bumpmap]]</code>.}}
{{Note|Effect only works on <code>[[$basetexture]]</code> and will not have the desired effect on the <code>[[$bumpmap]]</code>.}}
{{Bug|This parameter may not work on older hardware.}}
{{Bug|This parameter may not work on older hardware.}}
[[File:Difference.png|none|thumb|left|720px|Difference side by side, '''$pointsamplemagfilter''' (left) is pixelated and looks good in the distance as well]]


==VMT syntax example==
[[File:Difference.png|none|thumb|left|730px|Difference side by side, '''$pointsamplemagfilter''' (left) is pixelated and looks good in the distance as well]]
 
== VMT syntax example ==
  $pointsamplemagfilter <[[Boolean|bool]]>
  $pointsamplemagfilter <[[Boolean|bool]]>


[[Category:List of Shader Parameters]]
[[Category:Shader parameters|pointsamplemagfilter]]
[[Category:Glossary]]

Latest revision as of 00:42, 8 September 2025

English (en)Translate (Translate)


Example of $pointsamplemagfilter set to 1 and 0.

$pointsamplemagfilter is a material shader parameter available in Counter-Strike: Global Offensive Counter-Strike: Global Offensive, Strata Source Strata Source, Military Conflict: Vietnam Military Conflict: Vietnam, and Jabroni Brawl: Episode 3 Jabroni Brawl: Episode 3 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, unlike just enabling Point Sampling flag in a material's VTF.

Note.pngNote:Not compatible with blended displacement materials.
Note.pngNote:A similar effect can be achieved by enabling Point Sampling in a texture's VTF file (which works on all materials).
Note.pngNote:Effect only works on $basetexture and will not have the desired effect on the $bumpmap.
Icon-Bug.pngBug:This parameter may not work on older hardware.  [todo tested in ?]
Difference side by side, $pointsamplemagfilter (left) is pixelated and looks good in the distance as well

VMT syntax example

$pointsamplemagfilter <bool>