Advertisement Jump to content
Sign in to follow this  
Paragon123 Vector Arrays with shaders?

This topic is 857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, as far as I can tell...

Each time draws a tile it initializes a new draw call. (This is effectively immediate mode drawing right?)


When attempting to draw many sprites, arrayed like a tilemap the more efficent method is to generate a vertex array, filling it with the correct texture cords. This causes the entire tile map to get drawn in a single  draw call, right?


Is there a way to apply a specific shader to a specific cell using this method? Or more generally an arbitrary shader, with an arbitrary set of parameters to an arbitrary set of cells using vertex arrays? 


If there isn't, then how would a shader be used on the tiles in the tilemap without using Immediate mode to draw each sprite individually?


Do I have to do something complicated like create a uber shader that can call a different shader based on a value in a second texture? 

Draw a translucent image over the specific tiles with a shader that works on the existing pixels rather than the input pixels?

Edited by Paragon123

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!