This article's documentation is for anything that uses the Source engine. Click here for more information.

Fr/$translucent: Difference between revisions

From Valve Developer Community
< Fr
Jump to navigation Jump to search
No edit summary
m (Multipage removal)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{LanguageBar|title = $translucent}}
{{this is a|shader parameter|name=$translucent}}
{{toc-right}}
{{toc-right}}
 
{{finishtranslation}}
Le paramètre <code>$translucent</code> permet de rendre votre texture transparente de facon contrôler par pixel. Le canal Alpla est utilisé pour la transparence, le noir est transparent et le blanc opaque.
Le paramètre <code>$translucent</code> permet de rendre votre texture transparente de facon contrôler par pixel. Le canal Alpla est utilisé pour la transparence, le noir est transparent et le blanc opaque.
Les object avec un matériaux transparent ne sont pas affecter par le VIS, les NPC peuvent voir au travers.
Les object avec un matériaux transparent ne sont pas affecter par le VIS, les NPC peuvent voir au travers.
Line 7: Line 10:
== VMT syntax ==
== VMT syntax ==


  [[LightmappedGeneric]]
  {{L|LightmappedGeneric}}
  {
  {
  "$basetexture" "glass\window001a"
  "$basetexture" "glass\window001a"
Line 21: Line 24:


=== Clignotement ===
=== Clignotement ===
La translucidité peut parfois causé au matériaux des clignotement. Dans ce cas utilisé le paramètre <code>$alphatest</code>à la place de <code>$translucent</code>, vous perdrez en qualitée mais cela résoudra le problème.


=== Compatibility with other effects ===
La translucidité peut parfois causé au matériaux des clignotement. Dans ce cas utilisé le paramètre <code>$alphatest</code> à la place de <code>$translucent</code>, vous perdrez en qualitée mais cela résoudra le problème.
Certain shader parameters (such as <code>[[$envmap]]</code>) can disable translucency. If you are having trouble getting it to work, try commenting out other parts of the material.
 
=== Conpatibilité avec d'autres effects ===
 
Certains paramètre comme <code>$envmap</code> peuvent désacivez la transparence. SI vous avez ce problème essayer de rajouter des commentaires dans votre VMT.


=== Filtering borders ===
=== Filtering borders ===


[[Wikipedia:Texture filtering|Texture filtering]] will blend nearby pixels together even if some of of them are entirely transparent. This can create unwanted outlining effects if sudden drop-offs in alpha coincide with drop-offs in colour, which may well happen when the [[alpha channel]] reaches zero and you stop being able to see the pixels.
[[Wikipedia:Texture filtering|Texture filtering]] will blend nearby pixels together even if some of of them are entirely transparent. This can create unwanted outlining effects if sudden drop-offs in alpha coincide with drop-offs in colour, which may well happen when the {{L|alpha channel}} reaches zero and you stop being able to see the pixels.


[[Image:Decal anisotropic.jpg|center|An unwanted filtering border.]]
[[File:Decal anisotropic.jpg|center|An unwanted filtering border.]]


To resolve this issue, simply blend the colours of your image slightly beyond where the alpha channel drops off. This can be easily achieved by duplicating the translucent layer and smudging it into the relevant areas.
To resolve this issue, simply blend the colours of your image slightly beyond where the alpha channel drops off. This can be easily achieved by duplicating the translucent layer and smudging it into the relevant areas.


[[Image:Filterborder fixed.jpg|center|Fixing filtering borders.]]
[[File:Filterborder fixed.jpg|center|Fixing filtering borders.]]
 
('''Unfortunately for users of {{L|The GIMP}},''' the program will '''automatically remove colour information for pixels with an alpha of zero''' when the image is saved to TGA. The developers are aware of the the problems such behaviour creates [http://bugzilla.gnome.org/show_bug.cgi?id=411599#c4 but do not intend to change it]. A simple workaround is to save images as PNG rather than TGA, as The GIMP allows the preservation of colour information for transparent pixels when saving PNG images.  The resulting images can be imported into VTFEdit as normal, but cannot be used with VTex, as it does not offer PNG import support.)


('''Unfortunately for users of [[The GIMP]],''' the program will '''automatically remove colour information for pixels with an alpha of zero''' when the image is saved to TGA. The developers are aware of the the problems such behaviour creates [http://bugzilla.gnome.org/show_bug.cgi?id=411599#c4 but do not intend to change it]. A simple workaround is to save images as PNG rather than TGA, as The GIMP allows the preservation of colour information for transparent pixels when saving PNG images.  The resulting images can be imported into VTFEdit as normal, but cannot be used with VTex, as it does not offer PNG import support.)
{{ACategory|Shader parameters|translucent}}

Latest revision as of 03:52, 12 July 2024

English (en)Español (es)Français (fr)中文 (zh)Translate (Translate)

UNTRANSLATED string "this is a" see Template:This is a/strings

Info content.png
This page has not been fully translated.
You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)

Le paramètre $translucent permet de rendre votre texture transparente de facon contrôler par pixel. Le canal Alpla est utilisé pour la transparence, le noir est transparent et le blanc opaque. Les object avec un matériaux transparent ne sont pas affecter par le VIS, les NPC peuvent voir au travers.


VMT syntax

LightmappedGeneric(en)
{
	"$basetexture" "glass\window001a"
	"$translucent 1"
}

Additional parameters

$additive <bool>
Add the material's colour values to the existing image, instead of performing a multiplication. This means, among other things, that the material will always brighten the world.

Mise en garde

Clignotement

La translucidité peut parfois causé au matériaux des clignotement. Dans ce cas utilisé le paramètre $alphatest à la place de $translucent, vous perdrez en qualitée mais cela résoudra le problème.

Conpatibilité avec d'autres effects

Certains paramètre comme $envmap peuvent désacivez la transparence. SI vous avez ce problème essayer de rajouter des commentaires dans votre VMT.

Filtering borders

Texture filtering will blend nearby pixels together even if some of of them are entirely transparent. This can create unwanted outlining effects if sudden drop-offs in alpha coincide with drop-offs in colour, which may well happen when the alpha channel(en) reaches zero and you stop being able to see the pixels.

An unwanted filtering border.

To resolve this issue, simply blend the colours of your image slightly beyond where the alpha channel drops off. This can be easily achieved by duplicating the translucent layer and smudging it into the relevant areas.

Fixing filtering borders.

(Unfortunately for users of The GIMP(en), the program will automatically remove colour information for pixels with an alpha of zero when the image is saved to TGA. The developers are aware of the the problems such behaviour creates but do not intend to change it. A simple workaround is to save images as PNG rather than TGA, as The GIMP allows the preservation of colour information for transparent pixels when saving PNG images. The resulting images can be imported into VTFEdit as normal, but cannot be used with VTex, as it does not offer PNG import support.)