CustomShader_v2 Op
Write your own custom shader
Summary (oneliner)
<p>Write your own custom shader and use it as a material. Click the edit button to edit the fragment or vertex shader.</p> <p>To turn it into a texture use it together with the <a href="/op/Ops.Gl.Shader.Shader2Texture">Ops.Gl.Shader.Shader2Texture</a> op.</p> <p>UNIFORMS UNI float variableFloatName; //Use to create a uniform float UNI sampler2D variableTextureName; // use to create a texture input port IN vec2 texCoord; // Gives the UV co-ordinates from 0-1</p> <p>To display a texture on the screen Vec4 texIn = texture(variableTextureName,texCoord);</p>
- Ops.Gl.Shader.CustomShader_v2
- Core Op - Official cables op
- MIT
Documentation (markdown)
Issues
Example patch id
Youtube ids (comma seperated)
Op Licence
Caniuse query
Example Patch custom shader
the patch uses customShader Op to create a custom shader.
that shader is then rendered to a texture (displayed in the background)
the shader is also applied as a material and rendered on the cube.
Youtube Video Tutorial
INPUT PORTS
Trigger in
Source Code
A string can be passed in as a fragment shader. It's better to use an attachment
A string can be passed in as a vertex shader. It's better to use an attachment
Options
<i>boolean</i>
)Enable to use as a material
OUTPUT PORTS
<p>Trigger out</p>
<p>Shader/material out</p>
<i>boolean</i>
Number)