I tried to port my tileengine from a real “tile”-engine to an “shader”-tileengine.
I’ve uploaded the sourcecode here: https://github.com/EnemyArea/TileEngineShaderTest, feel free to use it (non commercial only please)
As you can see on the screenshot, it looks very good. But I have some issues I want to get rid. I pass my tile-informations as a color to the shader. This color needs all four components, which is realy bad if I want some transparency for it.
new Color(worldmapTile.TextureIndexModMulti / 32, worldmapTile.TextureIndexDivMulti / 32, sourceRectAutotileX1, sourceRectAutotileY1);
the first to components are the x and y position in the tileset and then position for the quad-tile-part of the full tile (One tile is made of 4 smaller tiles, to get the autotiling to work). This is exacly my problem. I looking for a good way to just use the rgb-component and keep the a-component free for transparency. In the moment I use a ‘colorkey’ to have a transparent color.
Have you guys some idears to optimize that shader and my code maybe?
PS: you guys must change this here:
in your Content.mgcb to get the content to work