CustomShader_v2 Op

CustomShader

Write your own custom shader


<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>


Full Name
  • Ops.Gl.Shader.CustomShader_v2
Visibility
  • Core Op - Official cables op
License
  • MIT
AuthorgithubPatchlistTest Patches


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.

Open In Editor

Youtube Video Tutorial

INPUT PORTS


render (Trigger)

<p>Trigger in</p>

Source Code

Fragment Code (String)

<p>A string can be passed in as a fragment shader. It&#39;s better to use an attachment</p>

Vertex Code (String)

<p>A string can be passed in as a vertex shader. It&#39;s better to use an attachment</p>

Options

Use As Material (Number:

<i>boolean</i>

)

<p>Enable to use as a material</p>

OUTPUT PORTS


trigger (Trigger)

<p>Trigger out</p>

Shader (Object)

<p>Shader/material out</p>

Has Errors (

<i>boolean</i>

Number)


Patches using CustomShader_v2

  • Custom Shader Examples (2)
  • Public
  • My Patches

Changelog


created opuser avatarpandur - 2019-05-13 13:34