summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-06-21 22:44:30 -0500
committerDave Parks <davep@lindenlab.com>2022-06-21 22:44:30 -0500
commit31e2fa5e50bc5aad265e8ec12613223eeb3ae3e1 (patch)
tree9d12d2067a03d5582fc0fe99d364f9917773fc37 /indra/llrender
parent8b4347cb10ab922f5001306912983cdd73a68309 (diff)
SL-17600 WIP -- Proper radiance maps (not just mipped cubemaps).
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llcubemaparray.cpp44
-rw-r--r--indra/llrender/llcubemaparray.h9
2 files changed, 52 insertions, 1 deletions
diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp
index e4081c1154..438d92cdba 100644
--- a/indra/llrender/llcubemaparray.cpp
+++ b/indra/llrender/llcubemaparray.cpp
@@ -53,6 +53,50 @@ GLenum LLCubeMapArray::sTargets[6] =
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
};
+LLVector3 LLCubeMapArray::sLookVecs[6] =
+{
+ LLVector3(1, 0, 0),
+ LLVector3(-1, 0, 0),
+ LLVector3(0, 1, 0),
+ LLVector3(0, -1, 0),
+ LLVector3(0, 0, 1),
+ LLVector3(0, 0, -1)
+};
+
+LLVector3 LLCubeMapArray::sUpVecs[6] =
+{
+ LLVector3(0, -1, 0),
+ LLVector3(0, -1, 0),
+ LLVector3(0, 0, 1),
+ LLVector3(0, 0, -1),
+ LLVector3(0, -1, 0),
+ LLVector3(0, -1, 0)
+};
+
+LLVector3 LLCubeMapArray::sClipToCubeLookVecs[6] =
+{
+ LLVector3(0, 0, -1), //GOOD
+ LLVector3(0, 0, 1), //GOOD
+
+ LLVector3(1, 0, 0), // GOOD
+ LLVector3(1, 0, 0), // GOOD
+
+ LLVector3(1, 0, 0),
+ LLVector3(-1, 0, 0),
+};
+
+LLVector3 LLCubeMapArray::sClipToCubeUpVecs[6] =
+{
+ LLVector3(-1, 0, 0), //GOOD
+ LLVector3(1, 0, 0), //GOOD
+
+ LLVector3(0, 1, 0), // GOOD
+ LLVector3(0, -1, 0), // GOOD
+
+ LLVector3(0, 0, -1),
+ LLVector3(0, 0, 1)
+};
+
LLCubeMapArray::LLCubeMapArray()
: mTextureStage(0)
{
diff --git a/indra/llrender/llcubemaparray.h b/indra/llrender/llcubemaparray.h
index 52e21f1dda..cbc0692afb 100644
--- a/indra/llrender/llcubemaparray.h
+++ b/indra/llrender/llcubemaparray.h
@@ -32,13 +32,20 @@
class LLVector3;
-// Environment map hack!
class LLCubeMapArray : public LLRefCount
{
public:
LLCubeMapArray();
static GLenum sTargets[6];
+
+ // look and up vectors for each cube face (agent space)
+ static LLVector3 sLookVecs[6];
+ static LLVector3 sUpVecs[6];
+
+ // look and up vectors for each cube face (clip space)
+ static LLVector3 sClipToCubeLookVecs[6];
+ static LLVector3 sClipToCubeUpVecs[6];
// allocate a cube map array
// res - resolution of each cube face