Hey! I’m beginning to learn to write 2D shaders, and I seem to have a problem… How can I access the UV-map coordinates? I know, basic question, but everything I’ve looked at hasn’t worked.
Dont think you can. I recently did a tutorial on manipulating texture co-ordinates, check the link in my signature, maybe it’ll help
Hello! With custom 2D filters (is it what you mean when you write “2D shaders”?), you play with the rendered texture. This texture has coordinates (gl_TexCoord[0]) from 0 to 1 on down/up axis and left/right axis. You can get screen positions of an object using scene.active_camera.getScreenPosition(MyObject) (the Y axis has to be negate). Or you can identify the object on the screen with its color… I don’t know if there are other way to isolate objects on the screen… Sorry if I did not understand the problem.
Are you making a 2d shader (viewport effect) or a material shader (affects material)?
Thanks, guys! I’ll check out your page, Battery. Yes, writing a material shader, not 2D filter. In the case that accessing UV coords is impossible, would it be possible to color the material with a texture in the normal materials tab, and then access that color in the shader?