Shader examples: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:
>;</syntaxhighlight>
>;</syntaxhighlight>
Surface normals are not usually present in the ground and building models, but are useful for creating lighting effects such as these.
Surface normals are not usually present in the ground and building models, but are useful for creating lighting effects such as these.
</td></tr></table>
==Road shine 2==
[[Image:RoadShine2Screen.jpg|200px|thumb|left|Road shine 2]]
<table border=0><tr><td valign=top height=170>
[http://nightly.mtasa.com/files/shaders/shader_roadshine2.zip Download  shader_roadshine2.zip]  (Requires Shader Model 2 graphics card)
<br><br>
Bit more complicated than the first Road shine, as it tracks the sun or moon to calculate the position of the highlight.
The effect can be hard to see depending on the time of day.
<br><br>
Best used with the play resource as the model it modifies is near the initial spawn point.
</td></tr></table>
</td></tr></table>


Line 25: Line 36:
</td></tr></table>
</td></tr></table>


==Road shine 2==
==UV scripted==
[[Image:RoadShine2Screen.jpg|200px|thumb|left|Road shine 2]]
[[Image:UVScriptedScreen.jpg|200px|thumb|left|UV scripted]]
<table border=0><tr><td valign=top height=170>
<table border=0><tr><td valign=top height=170>
[http://nightly.mtasa.com/files/shaders/shader_roadshine2.zip Download  shader_roadshine2.zip]
[http://nightly.mtasa.com/files/shaders/shader_uv_scripted.zip Download  shader_uv_scripted.zip]
<br><br>
Bit more complicated than the first Road shine, as it tracks the sun or moon to calculate the position of the highlight.
The effect can be hard to see depending on the time of day.
<br><br>
<br><br>
Best used with the play resource as the model it modifies is near the initial spawn point.
This resource controls a texture's UVs using Lua. It shows that anything is possible if you can imagine it.
</td></tr></table>
</td></tr></table>

Revision as of 19:10, 5 July 2011

Here are some example shader resources to try in 1.1. If you are looking to make your own, please be sure to read about the shader element as well.

Road shine

Road shine

Download shader_roadshine.zip (Requires Shader Model 2 graphics card)

This resource creates a light reflection effect on the ground (looks best when moving). It uses a custom flag in the effect file to generate surface normals for the ground model:

int CUSTOMFLAGS
<
    string createNormals = "yes";
>;

Surface normals are not usually present in the ground and building models, but are useful for creating lighting effects such as these.

Road shine 2

Road shine 2

Download shader_roadshine2.zip (Requires Shader Model 2 graphics card)

Bit more complicated than the first Road shine, as it tracks the sun or moon to calculate the position of the highlight. The effect can be hard to see depending on the time of day.

Best used with the play resource as the model it modifies is near the initial spawn point.

UV scroll

UV scroll

Download shader_uv_scroll.zip

This resource scrolls a texture from left to right. It doesn't use vertex or pixels shaders, so it should work on all hardware.

UV scripted

UV scripted

Download shader_uv_scripted.zip

This resource controls a texture's UVs using Lua. It shows that anything is possible if you can imagine it.