Finally somehow correct cubemap
This commit is contained in:
parent
84ee2dc70c
commit
79cfbeada3
@ -60,12 +60,12 @@ public:
|
|||||||
void SetGLCamAngleView();
|
void SetGLCamAngleView();
|
||||||
void SetGLCamView();
|
void SetGLCamView();
|
||||||
void SetGlIdentityView();
|
void SetGlIdentityView();
|
||||||
void SetGlPosXView();
|
void SetGlPosXView(bool renderToFrame = false);
|
||||||
void SetGlNegXView();
|
void SetGlNegXView(bool renderToFrame = false);
|
||||||
void SetGlPosYView();
|
void SetGlPosYView(bool renderToFrame = false);
|
||||||
void SetGlNegYView();
|
void SetGlNegYView(bool renderToFrame = false);
|
||||||
void SetGlPosZView();
|
void SetGlPosZView(bool renderToFrame = false);
|
||||||
void SetGlNegZView();
|
void SetGlNegZView(bool renderToFrame = false);
|
||||||
|
|
||||||
|
|
||||||
void MoveAlpha(float dAlpha);
|
void MoveAlpha(float dAlpha);
|
||||||
|
@ -190,9 +190,13 @@ void TSalmonRendererInterface::SetGLCamAngleView()
|
|||||||
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);
|
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);
|
||||||
|
|
||||||
RenderUniform3fv(CONST_STRING_CAMPOS_UNIFORM,CamPos.v);*/
|
RenderUniform3fv(CONST_STRING_CAMPOS_UNIFORM,CamPos.v);*/
|
||||||
|
|
||||||
LoadIdentity();
|
LoadIdentity();
|
||||||
|
TranslateMatrix(vec3(0.0f, 0.0f, -CamDist));
|
||||||
RotateMatrix(vec4(1.f * sin(CamPhi / 2.f), 0.f, 0.f, 1.f * cos(CamPhi / 2.f)));
|
RotateMatrix(vec4(1.f * sin(CamPhi / 2.f), 0.f, 0.f, 1.f * cos(CamPhi / 2.f)));
|
||||||
RotateMatrix(vec4(0.f, 1.f * sin(CamAlpha / 2.f), 0.f, 1.f * cos(CamAlpha / 2.f)));
|
RotateMatrix(vec4(0.f, 1.f * sin(CamAlpha / 2.f), 0.f, 1.f * cos(CamAlpha / 2.f)));
|
||||||
|
TranslateMatrix(CamPos);
|
||||||
|
|
||||||
|
|
||||||
CamModelViewMatrix = ModelviewMatrixStack.top();
|
CamModelViewMatrix = ModelviewMatrixStack.top();
|
||||||
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);
|
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);
|
||||||
@ -247,7 +251,7 @@ void TSalmonRendererInterface::SetGlIdentityView()
|
|||||||
SetUniforms();
|
SetUniforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSalmonRendererInterface::SetGlPosXView()
|
void TSalmonRendererInterface::SetGlPosXView(bool renderToFrame)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
@ -260,7 +264,15 @@ void TSalmonRendererInterface::SetGlPosXView()
|
|||||||
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);*/
|
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);*/
|
||||||
|
|
||||||
LoadIdentity();
|
LoadIdentity();
|
||||||
|
if (renderToFrame)
|
||||||
|
{
|
||||||
|
RotateMatrix(vec4(0.f, -1.f * sin(pi / 4.f), 0.f, 1.f * cos(pi / 4.f)));
|
||||||
|
RotateMatrix(vec4(0.f, 0.f, 1.f * sin(pi / 2.f), 1.f * cos(pi / 2.f)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
RotateMatrix(vec4(0.f, 1.f * sin(pi / 4.f), 0.f, 1.f * cos(pi / 4.f)));
|
RotateMatrix(vec4(0.f, 1.f * sin(pi / 4.f), 0.f, 1.f * cos(pi / 4.f)));
|
||||||
|
}
|
||||||
TranslateMatrix(-CamPos);
|
TranslateMatrix(-CamPos);
|
||||||
|
|
||||||
CamModelViewMatrix = ModelviewMatrixStack.top();
|
CamModelViewMatrix = ModelviewMatrixStack.top();
|
||||||
@ -270,7 +282,7 @@ void TSalmonRendererInterface::SetGlPosXView()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSalmonRendererInterface::SetGlNegXView()
|
void TSalmonRendererInterface::SetGlNegXView(bool renderToFrame)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
@ -283,7 +295,15 @@ void TSalmonRendererInterface::SetGlNegXView()
|
|||||||
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);*/
|
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);*/
|
||||||
|
|
||||||
LoadIdentity();
|
LoadIdentity();
|
||||||
RotateMatrix(vec4(0.f, -1.f * sin(pi / 4.f), 0.f, 1.f * cos(pi / 4.f)));
|
if (renderToFrame)
|
||||||
|
{
|
||||||
|
RotateMatrix(vec4(0.f, 1.f * sin(pi / 4.f), 0.f, 1.f * cos(pi / 4.f)));
|
||||||
|
RotateMatrix(vec4(0.f, 0.f, 1.f * sin(pi / 2.f), 1.f * cos(pi / 2.f)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RotateMatrix(vec4(0.f, 1.f * sin(pi / 4.f), 0.f, 1.f * cos(pi / 4.f)));
|
||||||
|
}
|
||||||
TranslateMatrix(-CamPos);
|
TranslateMatrix(-CamPos);
|
||||||
|
|
||||||
CamModelViewMatrix = ModelviewMatrixStack.top();
|
CamModelViewMatrix = ModelviewMatrixStack.top();
|
||||||
@ -292,7 +312,7 @@ void TSalmonRendererInterface::SetGlNegXView()
|
|||||||
SetUniforms();
|
SetUniforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSalmonRendererInterface::SetGlPosYView()
|
void TSalmonRendererInterface::SetGlPosYView(bool renderToFrame)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
@ -305,7 +325,7 @@ void TSalmonRendererInterface::SetGlPosYView()
|
|||||||
|
|
||||||
|
|
||||||
LoadIdentity();
|
LoadIdentity();
|
||||||
RotateMatrix(vec4(1.f * sin(pi / 4.f), 0.0f, 0.f, 1.f * cos(pi / 4.f)));
|
RotateMatrix(vec4(-1.f * sin(pi / 4.f), 0.0f, 0.f, 1.f * cos(pi / 4.f)));
|
||||||
TranslateMatrix(-CamPos);
|
TranslateMatrix(-CamPos);
|
||||||
|
|
||||||
CamModelViewMatrix = ModelviewMatrixStack.top();
|
CamModelViewMatrix = ModelviewMatrixStack.top();
|
||||||
@ -315,7 +335,7 @@ void TSalmonRendererInterface::SetGlPosYView()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSalmonRendererInterface::SetGlNegYView()
|
void TSalmonRendererInterface::SetGlNegYView(bool renderToFrame)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
@ -327,7 +347,7 @@ void TSalmonRendererInterface::SetGlNegYView()
|
|||||||
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);*/
|
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);*/
|
||||||
|
|
||||||
LoadIdentity();
|
LoadIdentity();
|
||||||
RotateMatrix(vec4(-1.f * sin(pi / 4.f), 0.0f, 0.f, 1.f * cos(pi / 4.f)));
|
RotateMatrix(vec4(1.f * sin(pi / 4.f), 0.0f, 0.f, 1.f * cos(pi / 4.f)));
|
||||||
TranslateMatrix(-CamPos);
|
TranslateMatrix(-CamPos);
|
||||||
|
|
||||||
CamModelViewMatrix = ModelviewMatrixStack.top();
|
CamModelViewMatrix = ModelviewMatrixStack.top();
|
||||||
@ -336,7 +356,7 @@ void TSalmonRendererInterface::SetGlNegYView()
|
|||||||
SetUniforms();
|
SetUniforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSalmonRendererInterface::SetGlPosZView()
|
void TSalmonRendererInterface::SetGlPosZView(bool renderToFrame)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
@ -349,6 +369,13 @@ void TSalmonRendererInterface::SetGlPosZView()
|
|||||||
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);
|
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
LoadIdentity();
|
||||||
|
RotateMatrix(vec4(0.f, 1.f * sin(pi / 2.f), 0.f, 1.f * cos(pi / 2.f)));
|
||||||
|
if (renderToFrame)
|
||||||
|
{
|
||||||
|
RotateMatrix(vec4(0.f, 0.f, 1.f * sin(pi / 2.f), 1.f * cos(pi / 2.f)));
|
||||||
|
}
|
||||||
TranslateMatrix(-CamPos);
|
TranslateMatrix(-CamPos);
|
||||||
|
|
||||||
/*LoadIdentity();
|
/*LoadIdentity();
|
||||||
@ -364,7 +391,7 @@ void TSalmonRendererInterface::SetGlPosZView()
|
|||||||
SetUniforms();
|
SetUniforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSalmonRendererInterface::SetGlNegZView()
|
void TSalmonRendererInterface::SetGlNegZView(bool renderToFrame)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
@ -376,8 +403,12 @@ void TSalmonRendererInterface::SetGlNegZView()
|
|||||||
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);*/
|
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);*/
|
||||||
|
|
||||||
LoadIdentity();
|
LoadIdentity();
|
||||||
|
//RotateMatrix(vec4(0.f, 1.f * sin(pi / 2.f), 0.f, 1.f * cos(pi / 2.f)));
|
||||||
|
if (renderToFrame)
|
||||||
|
{
|
||||||
|
RotateMatrix(vec4(0.f, 0.f, 1.f * sin(pi / 2.f), 1.f * cos(pi / 2.f)));
|
||||||
|
}
|
||||||
|
|
||||||
RotateMatrix(vec4(0.f, 1.f * sin(pi / 2.f), 0.f, 1.f * cos(pi / 2.f)));
|
|
||||||
TranslateMatrix(-CamPos);
|
TranslateMatrix(-CamPos);
|
||||||
|
|
||||||
CamModelViewMatrix = ModelviewMatrixStack.top();
|
CamModelViewMatrix = ModelviewMatrixStack.top();
|
||||||
|
Loading…
Reference in New Issue
Block a user