Es/$phong: Difference between revisions

From Valve Developer Community
< Es
Jump to navigation Jump to search
m (Nesciuse moved page $phong/es to Es/$phong over redirect: Language prefixes)
m (-Using L template for links)
Line 1: Line 1:
{{langsp}}
{{langsp}}
[[File:Alyx phong closeup.jpg|thumb|200px|Sombreado phong en la piel, el pelo y los labios de Alyx.]]
[[File:Alyx phong closeup.jpg|thumb|200px|Sombreado phong en la piel, el pelo y los labios de Alyx.]]
También está disponible en sombreado {{shader Name|LightmappedGeneric}} y {{Shader Name|WorldVertexTransition}} en todos los juegos desde {{csgo|4}}. proporcionando [https://es.wikipedia.org/wiki/Reflexi%C3%B3n_difusa reflexión difusa] a baja intensidad y [https://es.wikipedia.org/wiki/Resaltado_especular resaltado especular], enmascarados con una textura que controla su intensidad mediante téxeles. Para una explicación completa, véase [[Phong materials|materiales phong]].
También está disponible en sombreado {{shader Name|LightmappedGeneric}} y {{Shader Name|WorldVertexTransition}} en todos los juegos desde {{csgo|4}}. proporcionando [https://es.wikipedia.org/wiki/Reflexi%C3%B3n_difusa reflexión difusa] a baja intensidad y [https://es.wikipedia.org/wiki/Resaltado_especular resaltado especular], enmascarados con una textura que controla su intensidad mediante téxeles. Para una explicación completa, véase {{L|Phong materials|materiales phong}}.
{{Note|El sombreado phong <code>LightmappedGeneric</code> y <code>WorldVertexTransition</code> solo está disponible en {{csgobranch|4}}. Es necesario que la luz solar ilumine el material de una entidad {{ent|env_cascade_light}} para que funcione adecuadamente y usa sombras dinámicas generadas como máscara sobre las máscaras de sombreado tradicional ({{Strata|since}} {{ent|env_projectedtexture|4}} también afecta a los sólidos con sombreado phong activado)}}.
{{Note|El sombreado phong <code>LightmappedGeneric</code> y <code>WorldVertexTransition</code> solo está disponible en {{csgobranch|4}}. Es necesario que la luz solar ilumine el material de una entidad {{ent|env_cascade_light}} para que funcione adecuadamente y usa sombras dinámicas generadas como máscara sobre las máscaras de sombreado tradicional ({{Strata|since}} {{ent|env_projectedtexture|4}} también afecta a los sólidos con sombreado phong activado)}}.
{{Note|El sombreado phong para <code>LightmappedGeneric</code> también está disponible en {{mapbase|4}}, pero se implementa distinto.}}
{{Note|El sombreado phong para <code>LightmappedGeneric</code> también está disponible en {{mapbase|4}}, pero se implementa distinto.}}
{{important|En {{bms|4}} el reflejo de Lambert para [[NewLight Point|nuevas iluminaciones]] no funciona. Por tanto las mallas con [[$phong]] o [[$halflambert]] reciben luz de TODOS lados perpendicularmente. Si quieres usar [[$phong]] o [[$halflambert]] puedes corregir esto añadiendo para el material [[VMT]] el parámetro <code>"$halflambert_gbuffer_off"    "1"</code>.}}
{{important|En {{bms|4}} el reflejo de Lambert para {{L|NewLight Point|nuevas iluminaciones}} no funciona. Por tanto las mallas con {{L|$phong}} o {{L|$halflambert}} reciben luz de TODOS lados perpendicularmente. Si quieres usar {{L|$phong}} o {{L|$halflambert}} puedes corregir esto añadiendo para el material {{L|VMT}} el parámetro <code>"$halflambert_gbuffer_off"    "1"</code>.}}


==Sintaxis==
==Sintaxis==
  $phong <[[bool]]>
  $phong <{{L|bool}}>
{{note|Todos los parámetros del siguiente ejemplo deben estar especificados en el material, de otro modo el sombreado phong no se muestra, excepto en {{insurgency|4}}.}}
{{note|Todos los parámetros del siguiente ejemplo deben estar especificados en el material, de otro modo el sombreado phong no se muestra, excepto en {{insurgency|4}}.}}
:{{todo|Otros juegos que no necesitan parámetros phong (como Portal 2 en adelante)}}
:{{todo|Otros juegos que no necesitan parámetros phong (como Portal 2 en adelante)}}
Line 32: Line 32:
* '''If''' {{ent|$normalmapalphaenvmapmask}} is used, the {{ent|$bumpmap}}'s alpha channel will be used for Phong masking. Using either <code>$basemapalphaphongmask</code> or <code>$basemapluminancephongmask</code> will override it.
* '''If''' {{ent|$normalmapalphaenvmapmask}} is used, the {{ent|$bumpmap}}'s alpha channel will be used for Phong masking. Using either <code>$basemapalphaphongmask</code> or <code>$basemapluminancephongmask</code> will override it.
<br>
<br>
{{MatParam|$bumpmap|texture|Phong requires mask. The [[alpha channel]] of a [[$bumpmap|bump map]] acts as a Phong mask by default.}}
{{MatParam|$bumpmap|texture|Phong requires mask. The {{L|alpha channel}} of a {{L|$bumpmap|bump map}} acts as a Phong mask by default.}}
{{MatParam|$basemapalphaphongmask|bool|Use {{ent|$basetexture}}'s [[alpha channel]] as the Phong mask instead of <code>$bumpmap</code>'s [[alpha channel]].
{{MatParam|$basemapalphaphongmask|bool|Use {{ent|$basetexture}}'s {{L|alpha channel}} as the Phong mask instead of <code>$bumpmap</code>'s {{L|alpha channel}}.
{{warning|Using this with {{ent|$normalmapalphaenvmapmask}} will override the mask used for {{ent|$envmap}} to be the contents of the {{ent|$basetexture}}'s alpha channel!}}
{{warning|Using this with {{ent|$normalmapalphaenvmapmask}} will override the mask used for {{ent|$envmap}} to be the contents of the {{ent|$basetexture}}'s alpha channel!}}
{{warning|{{gmod|4}} Using this with {{ent|$normalmapalphaenvmapmask}} and {{ent|$envmap}} renders in {{ent|$envmap}} and '''<code>$phong</code>''' be masked by both '''<code>$basemapalphaphongmask</code>''' alpha channel and {{ent|$normalmapalphaenvmapmask}} alpha channel.}} |since={{src07}}|shaders=VertexLitGeneric}}
{{warning|{{gmod|4}} Using this with {{ent|$normalmapalphaenvmapmask}} and {{ent|$envmap}} renders in {{ent|$envmap}} and '''<code>$phong</code>''' be masked by both '''<code>$basemapalphaphongmask</code>''' alpha channel and {{ent|$normalmapalphaenvmapmask}} alpha channel.}} |since={{src07}}|shaders=VertexLitGeneric}}
Line 64: Line 64:
:{{note|<code>$envmap</code> is also affected by these fresnel ranges if both it and Phong are enabled in a material.}}
:{{note|<code>$envmap</code> is also affected by these fresnel ranges if both it and Phong are enabled in a material.}}
:{{note| drives the x component of a phongwarptexture if specified.}}|shaders=VertexLitGeneric, LightmappedGeneric({{mapbase|only}})}}
:{{note| drives the x component of a phongwarptexture if specified.}}|shaders=VertexLitGeneric, LightmappedGeneric({{mapbase|only}})}}
{{MatParam|$phongdisablehalflambert|bool|Disables forced [[$halflambert|half-lambertian]] shading on Phong materials. {{note|This parameter is effectively forced on in {{csgobranch|4}} due to <code>$halflambert</code> being disabled.}}|since={{as}}|also={{gmod}},{{Mapbase}}|shaders=VertexLitGeneric}}
{{MatParam|$phongdisablehalflambert|bool|Disables forced {{L|$halflambert|half-lambertian}} shading on Phong materials. {{note|This parameter is effectively forced on in {{csgobranch|4}} due to <code>$halflambert</code> being disabled.}}|since={{as}}|also={{gmod}},{{Mapbase}}|shaders=VertexLitGeneric}}


=== Colores ===
=== Colores ===
Line 73: Line 73:
{{MatParam|$phongalbedoboost|float|Phong albedo overbrightening factor. Ranges 0-255.
{{MatParam|$phongalbedoboost|float|Phong albedo overbrightening factor. Ranges 0-255.
: {{note| This will multiply the tint that is being applied to phong from $phongalbedotint.}}
: {{note| This will multiply the tint that is being applied to phong from $phongalbedotint.}}
: {{bug| This does not work when using [[$detail]]. }}|since={{csgo}}|also={{gmod}}|shaders=VertexLitGeneric}}
: {{bug| This does not work when using {{L|$detail}}. }}|since={{csgo}}|also={{gmod}}|shaders=VertexLitGeneric}}
[[File:Phongwarp example.png|thumb|200px|The Hunter without and with its <code>$phongwarptexture</code>, showing how it affects the Phong reflection.]]
[[File:Phongwarp example.png|thumb|200px|The Hunter without and with its <code>$phongwarptexture</code>, showing how it affects the Phong reflection.]]
{{MatParam|$phongtint|RGB matrix|Color tint of the phong reflection.
{{MatParam|$phongtint|RGB matrix|Color tint of the phong reflection.
Line 79: Line 79:
: {{note| Also tints {{ent|$rimlight}}}}|since={{src07}}|shaders=VertexLitGeneric}}
: {{note| Also tints {{ent|$rimlight}}}}|since={{src07}}|shaders=VertexLitGeneric}}
[[File:Phongwarp_coordinate_guide.png|thumb|200px|Breakdown of the $phongwarptexture: computed coordinates, texture and result]]
[[File:Phongwarp_coordinate_guide.png|thumb|200px|Breakdown of the $phongwarptexture: computed coordinates, texture and result]]
{{MatParam|$phongwarptexture|texture|Used to create an iridescence effect, as seen on Episode Two's [[npc_hunter|Hunters]].
{{MatParam|$phongwarptexture|texture|Used to create an iridescence effect, as seen on Episode Two's {{L|npc_hunter|Hunters}}.
: The highlight is multiplied with a texture. The coordinates of the sampled pixel are as follows:
: The highlight is multiplied with a texture. The coordinates of the sampled pixel are as follows:
:x: 1 - (distance to the center of the highlight)
:x: 1 - (distance to the center of the highlight)
Line 99: Line 99:


== Véase también ==
== Véase también ==
* [[Phong materials|Materiales phong]]
* {{L|Phong materials|Materiales phong}}
* {{ent|$envmap}} (mapa del entorno)
* {{ent|$envmap}} (mapa del entorno)
* {{ent|$lightwarptexture}}
* {{ent|$lightwarptexture}}
Line 105: Line 105:


== Enlaces externos ==
== Enlaces externos ==
* [https://tf2maps.net/threads/phong-on-brushes-the-hacky-way.26765 $Phong en sólidos*: The Hacky Way]: Una guía de TF2maps.net sobre cómo aplicar falsos $Phong en sólidos para juegos previos a CS:GO. También se puede usar para hacer phong falsos en [[prop_static|objetos del mapa]] iluminados por vértice, sin reducir su calidad.
* [https://tf2maps.net/threads/phong-on-brushes-the-hacky-way.26765 $Phong en sólidos*: The Hacky Way]: Una guía de TF2maps.net sobre cómo aplicar falsos $Phong en sólidos para juegos previos a CS:GO. También se puede usar para hacer phong falsos en {{L|prop_static|objetos del mapa}} iluminados por vértice, sin reducir su calidad.
*[https://share.substance3d.com/libraries/6595 SubstancePainter Sombreado phong complejo en motor Source]
*[https://share.substance3d.com/libraries/6595 SubstancePainter Sombreado phong complejo en motor Source]

Revision as of 08:21, 11 July 2024

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)
Sombreado phong en la piel, el pelo y los labios de Alyx.

También está disponible en sombreado Shader-ball.png LightmappedGeneric y Shader-ball.png WorldVertexTransition en todos los juegos desde Counter-Strike: Global Offensive Counter-Strike: Global Offensive. proporcionando reflexión difusa a baja intensidad y resaltado especular, enmascarados con una textura que controla su intensidad mediante téxeles. Para una explicación completa, véase materiales phong(en).

Note.pngNota:El sombreado phong LightmappedGeneric y WorldVertexTransition solo está disponible en CS:GO rama de motor CS:GO rama de motor. Es necesario que la luz solar ilumine el material de una entidad env_cascade_light para que funcione adecuadamente y usa sombras dinámicas generadas como máscara sobre las máscaras de sombreado tradicional ((en todos juegos desde Strata Source) env_projectedtexture 4 también afecta a los sólidos con sombreado phong activado)

.

Note.pngNota:El sombreado phong para LightmappedGeneric también está disponible en Mapbase Mapbase, pero se implementa distinto.
Icon-Important.pngImportante:En Black Mesa Black Mesa el reflejo de Lambert para nuevas iluminaciones(en) no funciona. Por tanto las mallas con $phong(en) o $halflambert(en) reciben luz de TODOS lados perpendicularmente. Si quieres usar $phong(en) o $halflambert(en) puedes corregir esto añadiendo para el material VMT(en) el parámetro "$halflambert_gbuffer_off" "1".

Sintaxis

$phong <bool(en)>
Note.pngNota:Todos los parámetros del siguiente ejemplo deben estar especificados en el material, de otro modo el sombreado phong no se muestra, excepto en Insurgency Insurgency.
Pendiente: Otros juegos que no necesitan parámetros phong (como Portal 2 en adelante)
VertexLitGeneric
{
	$phong 1

	$bumpmap				[texture]
	$phongexponent			5			// either/or
	$phongexponenttexture	[texture]	// either/or
	$phongboost				1.0
	$phongfresnelranges		"[0 0.5 1]"
}


Parámetros

Enmascarado

Warning.pngAviso:There are some caveats regarding $normalmapalphaenvmapmask and $selfillumfresnel when using $phong!


$bumpmap $basemapalphaphongmask $basemapluminancephongmask $phongexponent $phongexponenttexture $phongexponentfactor $invertphongmask $forcephong $diffuseexp $shinyblood $shinybloodexponent

Brillo

$phongboost $phongfresnelranges $phongdisablehalflambert

Colores

$phongalbedotint $phongalbedoboost

The Hunter without and with its $phongwarptexture, showing how it affects the Phong reflection.

$phongtint

Breakdown of the $phongwarptexture: computed coordinates, texture and result

$phongwarptexture

Brush phong in Counter-Strike: Global Offensive Counter-Strike: Global Offensive using tile/hr_t/inferno/tile_a. Note the complete absence of the reflection in the shaded area.

Parámetros de sombreado de sólidos (only in CS:GO rama de motor)(también en Garry's Mod)

$phongmaskcontrastbrightness $phongamount $phongbasetint

Comandos de consola

mat_phong <boolean(en)>
Desactiva o activa el sombreado phong. Por defecto 1.

Véase también

Enlaces externos