Resource:Shadermanager: Difference between revisions
Jump to navigation
Jump to search
(Began the compatibility section) |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 15: | Line 15: | ||
==Making your shader resource compatible with <em>shadermanager</em>== | ==Making your shader resource compatible with <em>shadermanager</em>== | ||
To make your shader resource compatible with shadermanager (which you should do), be sure to: | To make your shader resource compatible with shadermanager (which you should do), be sure to: | ||
*Setup your resource's [[Meta.xml|meta.xml]] file: | *Setup your resource's [[Meta.xml|meta.xml]] file properly: | ||
**Set the resource's type to "shader" | **Set the resource's type to "shader" | ||
**;<syntaxhighlight lang="lua"><info name="myawesomeshader" author="John_Michael" version="1.0.0" type="shader" description="My awesome shader!" /></syntaxhighlight> | **;<syntaxhighlight lang="lua"><info name="myawesomeshader" author="John_Michael" version="1.0.0" type="shader" description="My awesome shader!" /></syntaxhighlight> | ||
**Setup the resource's settings. You should provide a default state setting, that will determine whether or not the shader is enabled by default (use "0" for | **Setup the resource's settings. You should provide a default state setting, that will determine whether or not the shader is enabled by default (use "0" for disabled, "1" for enabled). If you do not provide this, it will default to "0". | ||
**;<syntaxhighlight lang="lua"><settings> <setting name="#shader_water.defaultState" value="1" /> </settings></syntaxhighlight> | **;<syntaxhighlight lang="lua"><settings> <setting name="#shader_water.defaultState" value="1" /> </settings></syntaxhighlight> | ||
*Ensure the following exported functions are available: | *Ensure the following exported functions are available: | ||
**(TODO) | **(TODO) |
Latest revision as of 04:23, 29 April 2012
Shadermanager is a planned resource to facilitate the managment of shaders in MTA, analogous to mapmanager for maps. This page is simply here to serve as a place to share the proposed system. To discuss, contact John on #mta.
Proposed Features
- Adoption of a "type='shader'" standard to allow shadermanager to find all the shaders on a server.
- Adoption of the #shadername.defaultState setting to determine whether or not to enable the shader by default (0 for no, 1 for yes, 0 by default).
- Minimalistic GUI to allow for the enabling/disabling of shaders.
- Small log to allow for viewing of shader-specific errors.
- Exported functions to allow shadermanager to function as a backend for other scripts (allowing someone else to implement their own GUI, for example).
- getShaderFromName, getAllShaders, setShaderEnabled, isShaderEnabled, isShaderCompatibleWithClient
- Adoption of certain exported functions for shaders to allow shadermanager to control all the shaders on a server.
- setShaderEnabled, isShaderEnabled
Making your shader resource compatible with shadermanager
To make your shader resource compatible with shadermanager (which you should do), be sure to:
- Setup your resource's meta.xml file properly:
- Set the resource's type to "shader"
<info name="myawesomeshader" author="John_Michael" version="1.0.0" type="shader" description="My awesome shader!" />
- Setup the resource's settings. You should provide a default state setting, that will determine whether or not the shader is enabled by default (use "0" for disabled, "1" for enabled). If you do not provide this, it will default to "0".
<settings> <setting name="#shader_water.defaultState" value="1" /> </settings>
- Set the resource's type to "shader"
- Ensure the following exported functions are available:
- (TODO)