I have a question about blending, maybe I’m incorrect about this but as far as I can tell if I want a texture to blend I need to draw it AFTER the textures I want blended with. For example if I have a water texture I want blended with the land beneath it, I need to draw the land first, then the water.
My question is if it is possible to have a texture blend with everything irregardless of when it is drawn. It will still need to pass the depth test of course so it isn’t drawn if something is in front of it.
Reason I ask is because I am drawing skyscraper buildings with some blended lights. When I draw the building I draw the walls, windows, and a few other things first, then draw the blended lights last, works just fine. However if I want to draw multiple buildings the lights don’t blend with later drawn objects.
I know I can work around this, but I’m hoping I don’t have to. For example I can do something like this:
for (int i=0; i<AllBuildings.size(); i++) {
AllBuildings[i].drawEverythingButLights();
}
for (int i=0; i<AllBuildings.size(); i++) {
AllBuildings[i].drawLights();
}
But I would rather do this:
for (int i=0; i<AllBuildings.size(); i++) {
AllBuildings[i].drawEverything();
}
Hopefully this makes sense…