How do I pass an object location into a vertex shader?

Posted by Greg Kassapidis on Game Development See other posts from Game Development or by Greg Kassapidis
Published on 2014-02-21T21:51:43Z Indexed on 2014/08/23 22:37 UTC
Read the original article Hit count: 257

I am using Blender Game Engine. I want to create a large flat plane, and deform it locally near a moving object.

So far (despite being a beginner at shaders) I've written a vertex shader for the plane which moves the vertices to their correct positions (constant positions, for now).

I cannot find a way to swap that constant location with an object's location updated every frame, while the shader is running. I am not even sure if it's possible. I only want to access a specific object's center from the shader.

© Game Development or respective owner

Related posts about shaders

Related posts about python