cjcliffe/CubicVR.js — Issue #46: Limitations on CustomShader
Author: lucasjadami
Created: 2011-10-28 00:53:17+00:00
State: open

Right now, it is not possible to specify a file for your shader source for 'CustomShader'. For example:

< script id="vs" src="lib/Shader.vs" type="x-shader/x-vertex">

< script id="fs" src="lib/Shader.fs" type="x-shader/x-fragment">
"

So, it is necessary to put the code on the html page, inside the script tags, like the demos available.

PS: One work around I have made:

On CubicVr.Utility.js, on the 'get' method, after it checks if '(idOrUrl[0] == '#')', I put:

if (url !== null) {
return util.getScriptContents(id);
}

So, if the tag has a 'src' defined, it will load the script from the file :P