http://www.oxeyegames.com/wiki/index.php?title=CreateCgShader&feed=atom&action=historyCreateCgShader - Revision history2024-03-28T08:31:37ZRevision history for this page on the wikiMediaWiki 1.16.0http://www.oxeyegames.com/wiki/index.php?title=CreateCgShader&diff=307&oldid=prevJeb: Created page with '{{VideoMethod| video.createCgShader(vertexShaderName, fragmentShaderName[, baseMaterial[, vertexFileMain, fragmentFileMain]]) | This method creates a shader material based on a v...'2010-01-02T20:21:13Z<p>Created page with '{{VideoMethod| video.createCgShader(vertexShaderName, fragmentShaderName[, baseMaterial[, vertexFileMain, fragmentFileMain]]) | This method creates a shader material based on a v...'</p>
<p><b>New page</b></p><div>{{VideoMethod|<br />
video.createCgShader(vertexShaderName, fragmentShaderName[, baseMaterial[, vertexFileMain, fragmentFileMain]])<br />
|<br />
This method creates a shader material based on a vertex and fragment shader HLSL file.<br />
|<br />
{{MethodParam|vertexShaderName|A string|The filename of the vertex shader.}}<br />
{{MethodParam|fragmentShaderName|A string|The filename of the fragment shader.}}<br />
{{MethodParam|baseMaterial|Optional integer|Shaders use the transparent alpha channel material as default (material type 12). Set this integer to use a different base material.}}<br />
{{MethodParam|vertexFileMain|Optional string|The name of the shader method in the vertex shader file. Defaults to "main".}}<br />
{{MethodParam|fragmentFileMain|Optional string|The name of the shader method in the fragment shader file. Defaults to "main".}}<br />
|<br />
Returns the new material type ID, or -1 if the shader fails to load.<br />
}}<br />
<br />
=== Example ===<br />
<pre><br />
local function createShaderMaterial()<br />
local vShader = "shaders/baseVertexCG.vsh"<br />
local pShader = "shaders/blackAndWhite.psh"<br />
local baseType = 12<br />
return video.createCgShader(vShader, pShader, baseType, "main", "main")<br />
end<br />
</pre><br />
<br />
=== See Also ===<br />
* [[Material Types]]</div>Jeb