Draw sky in a very expensive way

This commit is contained in:
Magnus Norddahl 2016-11-10 05:01:33 +01:00
commit 6c52e1e52b
2 changed files with 172 additions and 6 deletions

View file

@ -181,3 +181,24 @@ public:
static TriVertex *GetVertices(int count);
static void Clear();
};
class PolySkyDome
{
public:
PolySkyDome() { CreateDome(); }
void Render(const TriMatrix &worldToClip);
private:
TArray<TriVertex> mVertices;
TArray<unsigned int> mPrimStart;
int mRows, mColumns;
void SkyVertex(int r, int c, bool yflip);
void CreateSkyHemisphere(bool zflip);
void CreateDome();
void RenderRow(const TriUniforms &uniforms, FTexture *skytex, int row);
void RenderCapColorRow(const TriUniforms &uniforms, FTexture *skytex, int row, bool bottomCap);
TriVertex SetVertex(float xx, float yy, float zz, float uu = 0, float vv = 0);
TriVertex SetVertexXYZ(float xx, float yy, float zz, float uu = 0, float vv = 0);
};