1
$\begingroup$

Sorry for my english.

how can i show the code generate by the node and can i write my own node Element? Can i add a uniform float var? in order to comunicate with the fragment shaders?

$\endgroup$

2 Answers 2

1
$\begingroup$

The easiest way to insert your own data into a node shader is to use vertex or object color (max of 3 floats each = 6 floats). Other than that you can either:

  • Use an image as an input, using a specific UV lookup, and then using python to set a pixels colour.
  • use your own GLSL shader (which means you have to do all the lighting yourself, and real time shadows become hard),
  • create your own node (which involves recompiling blender itself).

I wish there were a better way than the three above, but if there are, I am unaware of them.

$\endgroup$
0
$\begingroup$

I find a solution to export the material to GLSL and to it.

First install the plugin export to glsl. Export the material. Modify the fragment shader or vertex. For example change const to uniform, and charge the shaders.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .