Difference between revisions of "EffectShader"

2,904 bytes added ,  12:06, 17 October 2018
→‎Notes: bad command names
imported>Danielleonyett
imported>DavidJCobb
(→‎Notes: bad command names)
 
(12 intermediate revisions by 3 users not shown)
Line 3: Line 3:
The shader can consist of two components, a Membrane Shader and a Particle Shader.
The shader can consist of two components, a Membrane Shader and a Particle Shader.


[[File:EffectShaderWindow.png|900px]]


==Membrane Shader==
==Membrane Shader==
Line 25: Line 26:


''Source Alpha''
''Source Alpha''
:: RGB components of source pixel multiplied by alpha (Multiplies all channels with the source alpha)
:: RGB components of source pixel multiplied by alpha. (Multiplies all channels with the source alpha)


''Source Inverted Alpha''
''Source Inverted Alpha''
:: RGB components of source pixel multiplied by 1 - alpha (Multiplies all channels with one minus the source alpha)
:: RGB components of source pixel multiplied by 1 - alpha. (Multiplies all channels with one minus the source alpha)


''Source Color''
''Source Color''
:: Color of source pixel (Multiplies each component with the respective component in the source color)
:: Color of source pixel. (Multiplies each component with the respective component in the source color)


''Source Inverse Color''
''Source Inverse Color''
:: Color of source pixel subtracted per component from white (Multiplies each component with one minus the respective component in the source color)
:: Color of source pixel subtracted per component from white. (Multiplies each component with one minus the respective component in the source color)


''Dest Alpha''
''Dest Alpha''
:: RGB components of destination pixel multiplied by alpha (Multiplies all channels with the destination alpha)
:: RGB components of destination pixel multiplied by alpha. (Multiplies all channels with the destination alpha)


''Dest Inverted Alpha''
''Dest Inverted Alpha''
:: RGB components of destination pixel multiplied by 1 - alpha (Multiplies all channels with one minus the destination alpha)
:: RGB components of destination pixel multiplied by 1 - alpha. (Multiplies all channels with one minus the destination alpha)


''Dest Color''
''Dest Color''
:: Color of destination pixel (Multiplies each component with the respective component in the destination color)
:: Color of destination pixel. (Multiplies each component with the respective component in the destination color)


''Dest Inverse Color''
''Dest Inverse Color''
:: Color of destination pixel subtracted per component from white (Multiplies each component with one minus the respective component in the destination color)
:: Color of destination pixel subtracted per component from white. (Multiplies each component with one minus the respective component in the destination color)


''Source Alpha SAT''
''Source Alpha SAT''
Line 56: Line 57:
This section determines how the source and destination functions are combined. Options are as follows:
This section determines how the source and destination functions are combined. Options are as follows:


''Add'' - (Result = Source + Destination)
''Add'' - (Result = Source + Destination) (This blend mode simply adds pixel values of one layer with the other. In case of values above 1 (in the case of RGB), white is displayed.)


''Subtract'' - (Result = Source - Destination)
''Subtract'' - (Result = Source - Destination) (This blend mode simply subtracts pixel values of one layer with the other. In case of negative values, black is displayed.)


''Reverse Subtract'' - (Result = Destination - Source)
''Reverse Subtract'' - (Result = Destination - Source) (Difference subtracts the top layer from the bottom layer or the other way round, to always get a positive value. Blending with black produces no change, as values for all colors are 0. (The RGB value for black is 0,0,0). Blending with white inverts the picture.)


''Minimum'' - (Result = MIN(Source, Destination))
''Minimum'' - (Result = MIN(Source, Destination)) (Creates a resultant pixel that retains the smallest components of the foreground and background pixels.)


''Maximum'' - (Result = MAX(Source, Destination))
''Maximum'' - (Result = MAX(Source, Destination)) (Selects the maximum of each component from the foreground and background pixels.)




Line 86: Line 87:
'''Z Test Function'''
'''Z Test Function'''


Defaults to Equal To. If changed to Greater Than or Greater Than or Equal To, the membrane shader will be displayed on top of other geometry and will be visible through walls (unconfirmed).
This value defaults to Equal To. The "Greater Than" and "Greater Than or Equal To" values are supposed to change the depth of the shader effects, allowing it to show through walls; however, this behavior is broken in Skyrim.


''Equal To'' - (A pixel is drawn if its depth value is exactly equal to the corresponding value stored in the Z-Buffer)
(The z-buffer, or depth buffer, is used to ensure that objects are displayed according to their depth. During rendering of a triangle, the Z-value of a given pixel is compared to the value stored in the Z-Buffer. Based on the Z-testing function, the triangle either is allowed to overdraw the pixel or not. The default behavior is to accept pixel that have a Z-value that is smaller or the same as the value in the Z-Buffer, making objects closer to the camera occlude objects which are farther away.)
 
''Greater Than'' - (A pixel is drawn if its depth value is greater (not equal) than the corresponding value stored in the Z-Buffer)
 
''Greater Than or Equal To'' - (A pixel is drawn if its depth value is greater than or equal to the corresponding value stored in the Z-Buffer)




Line 114: Line 111:


''Alpha Pulse Amplitude''
''Alpha Pulse Amplitude''
:: How noticeable the pulsation of the shader is. Relevant only when one of the blend modes has been set to Source (inverted) Alpha.
:: How noticeable the pulsation of the shader is; a multiplier applied to the ''Full'' or ''Persistent Alpha Ratio''. Relevant only when one of the blend modes has been set to Source (inverted) Alpha.


''Alpha Pulse Frequency''
''Alpha Pulse Frequency''
:: How often the shader exhibits a pulse. It may be easier to consider that the period of any given pulse would be 1 second divided by the frequency of the pulses (i.e. larger values give shorter pulses, decimal values below 1 give longer pulses).  
:: How often the shader exhibits a pulse. It may be easier to consider that the period of any given pulse would be 1 second divided by the frequency of the pulses (i.e. larger values give shorter pulses, decimal values below 1 give longer pulses).


''Texture Animation Speed (U, V)''
''Texture Animation Speed (U, V)''
Line 123: Line 120:


''Texture Scale (U, V)''
''Texture Scale (U, V)''
:: A larger value will repeat the texture more frequently on the surface of the target object.  
:: A larger value will repeat the texture more frequently on the surface of the target object.
 
{{InDepth|Here's an explanation of the alpha/opacity values for those who find prose easier to understand:
 
When a shader is first applied, it immediately uses ''Full Alpha Ratio'' as its opacity for ''Full Alpha Time''; after that, the shader fades in from ''Full Alpha Ratio'' to ''Persistent Alpha Ratio'' over ''Alpha Fade Out Time''. Over the course of the shader's lifetime (including during fades), the opacity will vary by up to ''Alpha Pulse Ratio'' (multiplied by the ''Full'' or ''Persistent Alpha Ratio'') at a rate of ''Alpha Pulse Frequency'' times per second. When the shader is removed from a reference, it will always fade out from its current opacity to zero over ''Alpha Fade Out Time''.
 
The fade-in behavior changes if the ''Persistent Alpha Ratio'' is greater than the ''Full Alpha Ratio'': in this case, the shader will instantly switch from ''Full Alpha Ratio'' to ''Persistent Alpha Ratio'' at the end of the ''Full Alpha Time''. This is implied by the names of the settings -- "full," as in "maximum," alpha ratio -- but it's still not necessarily what one might expect, and it's definitely the less useful behavior.}}




Line 129: Line 132:
:: Press the Edit button to add a texture instead of using a solid color. To remove an image file, press this button and cancel the dialogue window that appears.
:: Press the Edit button to add a texture instead of using a solid color. To remove an image file, press this button and cancel the dialogue window that appears.
''Palette Texture''
''Palette Texture''
:: Press the Edit button to ?
:: Press the Edit button to define a palette texture. The exact function of this texture is unknown, but if one isn't defined, your shader ''may'' not work.


''Ignore Alpha''
''Ignore Alpha''
Line 185: Line 188:


== Particle Shader ==
== Particle Shader ==
Use the Particle Shader section to create particles that will emit from the target object.
Use the Particle Shader section to create particles that will emit from the target object. These effects are limited to ObjectReferences that are also Actors; trying to emit particles from a piece of armor or another inanimate object will prove fruitless.
These effects are limited to ObjectReferences that are also Actors.  


Trying to emit particles from a piece of armor or another inanimate object will prove fruitless.
The method of particle alpha blending is determined by the Source and Dest Blend Modes. Refer to the Membrane Shader section.
 
The method of particle alpha blending is determined by the Source and Dest Blend Modes.
Refer to the Membrane Shader section.


{| class="wikitable"
{| class="wikitable"
Line 321: Line 320:


''Scale Out Time:'' The time it takes for the debris models to scale out (from End Scale to Start Scale).
''Scale Out Time:'' The time it takes for the debris models to scale out (from End Scale to Start Scale).
== Notes ==
* Remember that your shaders are (generally) triggered by spells; those spells can have unintuitive effects on how the shader behaves, breaking the behavior of the various fade options. It's best to test your EffectShaders independently by using the ''PlayMagicShaderVisuals'' (''PMS'') and ''StopMagicShaderVisuals'' (''SMS'') console commands; both run on an actor and take the form ID of a shader.
** In some particularly bizarre cases, magic effects that trigger on different conditions can break each other's shaders if they're part of the same spell; yet they and their shaders work perfectly fine if they're separated out into different spells.


[[Category:Object Classes]]
[[Category:Object Classes]]
[[Category:Special Effect]]
[[Category:Special Effect]]
Anonymous user