This is added in the spirit of the general cycles GLSL system which is pretty much WIP still. This will only work on cycles at the moment but generating for blender internal is possible too of course though it will be done in a separate commit. This hasn't been tested with all and every node in cycles, but environment and regular textures with texture coordinates work. There is some difference between the way cycles treats some coordinates, which is in world space and the way GLSL treats them, which is in view space. We might want to explore and improve this further in the future. ...also </drumroll>
14 lines
231 B
GLSL
14 lines
231 B
GLSL
|
|
varying vec3 varposition;
|
|
varying vec3 varnormal;
|
|
|
|
void main()
|
|
{
|
|
/* position does not need to be transformed, we already have it */
|
|
gl_Position = gl_Vertex;
|
|
|
|
varposition = gl_Vertex.xyz;
|
|
|
|
varnormal = normalize(-varposition);
|
|
|