SFML.net Vector Arrays with shaders?

Started by
0 comments, last by HappyCoder 7 years, 7 months ago

So, as far as I can tell...

Each time SFML.net 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?

Advertisement

You could group tile draw calls by shader.

My current game project Platform RPG

This topic is closed to new replies.

Advertisement