beta
cables is under heavy development.
There might be one or another bug, please let us know about it!

CustomShader_v2 Op

Ops.Gl.Shader.CustomShader_v2


CustomShader
Collections:Material  
Namespace: Ops.Gl.Shader

Op author: pandur

Write your own custom shader


summary (oneliner)

Write your own custom shader and use it as a material.
Click the edit button to edit the fragment or vertex shader.

To turn it into a texture use it together with the Ops.Gl.Shader.Shader2Texture op.

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

To display a texture on the screen
Vec4 texIn = texture(variableTextureName,texCoord);



doc

issues

example patch id

youtube id

caniuse query

collections

related ops

Inputs

render (Trigger)

Trigger in


Source Code

Fragment Code (String)

A string can be passed in as a fragment shader. It's better to use an attachment


Vertex Code (String)

A string can be passed in as a vertex shader. It's better to use an attachment


Options

Use As Material (boolean /Number)

Enable to use as a material


Outputs

trigger (Trigger)

Trigger out


Shader (Object)

Shader/material out


Has Errors (boolean Number)

Caught a mistake or want to contribute to the documentation?

Edit Documentationcancel save

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 Example In Editor


Youtube Video Tutorial

Patches using CustomShader_v2

Changelog


created op
2019-05-13 - pandur

Ops.Exp.Gl.Shader.CustomShader2 renamed to Ops.Gl.Shader.CustomShader_v2
2020-04-20 - pandur