Resource:Shadermanager: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "Shadermanager is a <em>planned</em> 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 shar...")
 
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Resource page}}
{{Warning|This is a <em>planned</em> resource (it's not ready yet!)|true}}
Shadermanager is a <em>planned</em> 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 [[User:John|John]] on #mta.
Shadermanager is a <em>planned</em> 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 [[User:John|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 <em>shadermanager</em>==
To make your shader resource compatible with shadermanager (which you should do), be sure to:
*Setup your resource's [[Meta.xml|meta.xml]] file properly:
**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>
**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>
*Ensure the following exported functions are available:
**(TODO)

Latest revision as of 04:23, 29 April 2012

Dialog-warning.png Warning: This is a planned resource (it's not ready yet!)

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>
  • Ensure the following exported functions are available:
    • (TODO)