Finally working decent sky
175
Template/log.txt
@ -1,108 +1,133 @@
|
||||
2024-Jun-08 23:23:28: Log started
|
||||
2024-Jun-08 23:23:28: OpenGL Window created
|
||||
2024-Jun-08 23:23:28: Script manager ready
|
||||
2024-Jun-08 23:23:28: Render::OpenGL glVersion = 4.6.0 - Build 31.0.101.4887
|
||||
2024-Jun-08 23:23:28: Render::OpenGL glVersion above 2.0 ok
|
||||
2024-Jun-08 23:23:28: Render::OpenGL GL_ARB_framebuffer_object supported ok
|
||||
2024-Jun-08 23:23:28: Render::OpenGL GL_ARB_uniform_buffer_object supported ok
|
||||
2024-Jun-08 23:23:28: Prepare to add shader GUI
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: Log started
|
||||
2024-Jun-09 01:08:21: OpenGL Window created
|
||||
2024-Jun-09 01:08:21: Script manager ready
|
||||
2024-Jun-09 01:08:21: Render::OpenGL glVersion = 4.6.0 - Build 31.0.101.4887
|
||||
2024-Jun-09 01:08:21: Render::OpenGL glVersion above 2.0 ok
|
||||
2024-Jun-09 01:08:21: Render::OpenGL GL_ARB_framebuffer_object supported ok
|
||||
2024-Jun-09 01:08:21: Render::OpenGL GL_ARB_uniform_buffer_object supported ok
|
||||
2024-Jun-09 01:08:21: Prepare to add shader GUI
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: Shader program is - 3
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager shader loaded: GUI
|
||||
2024-Jun-08 23:23:28: Prepare to add shader Parallax
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: Shader program is - 3
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: GUI
|
||||
2024-Jun-09 01:08:21: Prepare to add shader Parallax
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
WARNING: 0:27: 'assign' : implicit type conversion allowed from GLSL 1.20
|
||||
WARNING: 0:27: 'assign' : implicit type conversion allowed from GLSL 1.20
|
||||
WARNING: 0:27: 'assign' : implicit type conversion allowed
|
||||
2024-Jun-08 23:23:28: Shader program is - 6
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager shader loaded: Parallax
|
||||
2024-Jun-08 23:23:28: Prepare to add shader Directlight
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: Shader program is - 6
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: Parallax
|
||||
2024-Jun-09 01:08:21: Prepare to add shader Directlight
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: Shader program is - 9
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager shader loaded: Directlight
|
||||
2024-Jun-08 23:23:28: Prepare to add shader Env
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: Shader program is - 9
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: Directlight
|
||||
2024-Jun-09 01:08:21: Prepare to add shader Env
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: Shader program is - 12
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager shader loaded: Env
|
||||
2024-Jun-08 23:23:28: Prepare to add shader Water
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: Shader program is - 12
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: Env
|
||||
2024-Jun-09 01:08:21: Prepare to add shader EnvReverse
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: Shader program is - 15
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager shader loaded: Water
|
||||
2024-Jun-08 23:23:28: Prepare to add shader Frame
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: Shader program is - 15
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: EnvReverse
|
||||
2024-Jun-09 01:08:21: Prepare to add shader Water
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
WARNING: 0:29: 'assign' : implicit type conversion allowed from GLSL 1.20
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: Shader program is - 18
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager shader loaded: Frame
|
||||
2024-Jun-08 23:23:28: Prepare to add shader Lightview
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:5: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: Shader program is - 18
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: Water
|
||||
2024-Jun-09 01:08:21: Prepare to add shader Frame
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: Shader program is - 21
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager shader loaded: Lightview
|
||||
2024-Jun-08 23:23:28: Prepare to add shader Simple3D
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: Shader program is - 21
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: Frame
|
||||
2024-Jun-09 01:08:21: Prepare to add shader Lightview
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:5: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-08 23:23:28: Shader program is - 24
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-08 23:23:28: ResourceManager::ShaderManager shader loaded: Simple3D
|
||||
2024-Jun-08 23:23:28: ResourceManager::TexList Texture added: bt_box_yellow.bmp with id = 1
|
||||
2024-Jun-08 23:23:28: ResourceManager::TexList Texture added: bt_box_norm.bmp32 with id = 2
|
||||
2024-Jun-08 23:23:28: Lite model added successfully: models/bt_box_yellow.lm1
|
||||
2024-Jun-08 23:23:28: ResourceManager::TexList Texture added: bt_cone.bmp with id = 3
|
||||
2024-Jun-08 23:23:28: Lite model added successfully: models/bt_cone.lm1
|
||||
2024-Jun-08 23:23:28: Lite model added successfully: models/girl.lm1
|
||||
2024-Jun-08 23:23:29: Lite model added successfully: models/bonemodel.lm1
|
||||
2024-Jun-08 23:23:30: ResourceManager::TexList Texture added: out.bmp with id = 4
|
||||
2024-Jun-08 23:23:30: FrameManager:: frame buffer added: Skybox
|
||||
2024-Jun-08 23:23:30: ResourceManager::TexList Texture added: normalmap.bmp with id = 6
|
||||
2024-Jun-08 23:23:30: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/posx.bmp
|
||||
2024-Jun-08 23:23:30: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/negx.bmp
|
||||
2024-Jun-08 23:23:30: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/posy.bmp
|
||||
2024-Jun-08 23:23:30: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/negy.bmp
|
||||
2024-Jun-08 23:23:30: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/posz.bmp
|
||||
2024-Jun-08 23:23:30: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/negz.bmp
|
||||
2024-Jun-08 23:23:30: ResourceManager::TexList texture added succesfuly: posx.bmp
|
||||
2024-Jun-08 23:23:30: FrameManager:: frame buffer added: ScreenBlur
|
||||
2024-Jun-08 23:23:30: FrameManager:: frame buffer added: ShadowBufferGlobal
|
||||
2024-Jun-08 23:23:30: FrameManager:: frame buffer added: ShadowBufferLocal
|
||||
2024-Jun-09 01:08:21: Shader program is - 24
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: Lightview
|
||||
2024-Jun-09 01:08:21: Prepare to add shader Simple3D
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
|
||||
|
||||
|
||||
2024-Jun-09 01:08:21: Shader program is - 27
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager::Shader
|
||||
2024-Jun-09 01:08:21: ResourceManager::ShaderManager shader loaded: Simple3D
|
||||
2024-Jun-09 01:08:21: ResourceManager::TexList Texture added: bt_box_yellow.bmp with id = 1
|
||||
2024-Jun-09 01:08:21: ResourceManager::TexList Texture added: bt_box_norm.bmp32 with id = 2
|
||||
2024-Jun-09 01:08:21: Lite model added successfully: models/bt_box_yellow.lm1
|
||||
2024-Jun-09 01:08:21: ResourceManager::TexList Texture added: bt_cone.bmp with id = 3
|
||||
2024-Jun-09 01:08:21: Lite model added successfully: models/bt_cone.lm1
|
||||
2024-Jun-09 01:08:22: Lite model added successfully: models/girl.lm1
|
||||
2024-Jun-09 01:08:22: Lite model added successfully: models/bonemodel.lm1
|
||||
2024-Jun-09 01:08:23: ResourceManager::TexList Texture added: out.bmp with id = 4
|
||||
2024-Jun-09 01:08:23: FrameManager:: frame buffer added: Skybox
|
||||
2024-Jun-09 01:08:23: ResourceManager::TexList Texture added: normalmap.bmp with id = 6
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posx.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negx.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posy.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negy.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posz.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negz.bmp
|
||||
2024-Jun-09 01:08:23: ResourceManager::TexList texture added succesfuly: posx.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_rt.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_lf.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_dn.bmp
|
||||
2024-Jun-09 01:08:23: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_up.bmp
|
||||
2024-Jun-09 01:08:24: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_bk.bmp
|
||||
2024-Jun-09 01:08:24: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_ft.bmp
|
||||
2024-Jun-09 01:08:24: ResourceManager::TexList texture added succesfuly: yavin_rt.bmp
|
||||
2024-Jun-09 01:08:24: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_rt.bmp
|
||||
2024-Jun-09 01:08:24: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_lf.bmp
|
||||
2024-Jun-09 01:08:24: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_up.bmp
|
||||
2024-Jun-09 01:08:24: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_dn.bmp
|
||||
2024-Jun-09 01:08:24: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_bk.bmp
|
||||
2024-Jun-09 01:08:24: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_ft.bmp
|
||||
2024-Jun-09 01:08:25: ResourceManager::TexList texture added succesfuly: space_rt.bmp
|
||||
2024-Jun-09 01:08:25: FrameManager:: frame buffer added: ScreenBlur
|
||||
2024-Jun-09 01:08:25: FrameManager:: frame buffer added: ShadowBufferGlobal
|
||||
2024-Jun-09 01:08:25: FrameManager:: frame buffer added: ShadowBufferLocal
|
||||
|
@ -13,42 +13,54 @@ void TMyApplication::DrawToCubemap()
|
||||
Renderer->PushShader("Directlight");
|
||||
|
||||
Renderer->SwitchToCubemapBuffer("Skybox",0);
|
||||
Renderer->SetGlPosXView(true);
|
||||
DrawSceneWithoutWater();
|
||||
Renderer->SetGlPosXView(false, true);
|
||||
DrawCubemapDay();
|
||||
Renderer->SetGlPosXView(true, true);
|
||||
GameMap.DrawVBO();
|
||||
//glClearColor()
|
||||
//glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
Renderer->SwitchToCubemapBuffer("Skybox",1);
|
||||
Renderer->SetGlNegXView(true);
|
||||
Renderer->SetGlNegXView(false, true);
|
||||
DrawCubemapDay();
|
||||
Renderer->SetGlNegXView(true, true);
|
||||
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
DrawSceneWithoutWater();
|
||||
GameMap.DrawVBO();
|
||||
|
||||
Renderer->SwitchToCubemapBuffer("Skybox",2);
|
||||
Renderer->SetGlPosYView(true);
|
||||
DrawSceneWithoutWater();
|
||||
Renderer->SetGlPosYView(false, true);
|
||||
DrawCubemapDay();
|
||||
Renderer->SetGlPosYView(true, true);
|
||||
GameMap.DrawVBO();
|
||||
//glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
Renderer->SwitchToCubemapBuffer("Skybox",3);
|
||||
Renderer->SetGlNegYView(true);
|
||||
Renderer->SetGlNegYView(false, true);
|
||||
DrawCubemapDay();
|
||||
Renderer->SetGlNegYView(true, true);
|
||||
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
DrawSceneWithoutWater();
|
||||
GameMap.DrawVBO();
|
||||
|
||||
Renderer->SwitchToCubemapBuffer("Skybox",4);
|
||||
Renderer->SetGlPosZView(true);
|
||||
DrawSceneWithoutWater();
|
||||
Renderer->SetGlPosZView(false, true);
|
||||
DrawCubemapDay();
|
||||
Renderer->SetGlPosZView(true, true);
|
||||
GameMap.DrawVBO();
|
||||
//glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
|
||||
Renderer->SwitchToCubemapBuffer("Skybox",5);
|
||||
Renderer->SetGlNegZView(true);
|
||||
Renderer->SetGlNegZView(false, true);
|
||||
DrawCubemapDay();
|
||||
Renderer->SetGlNegZView(true, true);
|
||||
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
DrawSceneWithoutWater();
|
||||
GameMap.DrawVBO();
|
||||
|
||||
Renderer->SwitchToScreen();
|
||||
|
||||
@ -71,6 +83,9 @@ void TMyApplication::DrawToShadowMap()
|
||||
|
||||
void TMyApplication::DrawSceneWithoutWater()
|
||||
{
|
||||
Renderer->SetGLCamAngleView();
|
||||
DrawCubemapDay();
|
||||
Renderer->SetGLCamView();
|
||||
GameMap.DrawVBO();
|
||||
}
|
||||
|
||||
@ -122,6 +137,29 @@ void TMyApplication::DrawCubemap()
|
||||
Renderer->PopShader();
|
||||
}
|
||||
|
||||
void TMyApplication::DrawCubemapDay()
|
||||
{
|
||||
Renderer->PushShader("EnvReverse");
|
||||
//Renderer->SetGLCamAngleView();
|
||||
//Renderer->SetGLCamAngleView();
|
||||
//Renderer->LoadIdentity();
|
||||
RenderUniformMatrix3fv(CONST_STRING_MODELROTATEMATRIX_UNIFORM, false, (float*)IdentityMatrix.m);
|
||||
RenderUniform3fv(CONST_STRING_MODELTRANSLATEVECTOR_UNIFORM, (float*)ZeroVec3.v);
|
||||
|
||||
//glBindTexture(GL_TEXTURE_CUBE_MAP, ResourceManager->FrameManager.GetFrameTexture("Skybox"));
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, cubemapTextureDay);
|
||||
|
||||
EnableVertexAttribArray("vPosition");
|
||||
|
||||
DrawVertexDataStruct(cubemapVertexDataStruct);
|
||||
|
||||
DisableVertexAttribArray("vPosition");
|
||||
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
Renderer->PopShader();
|
||||
}
|
||||
|
||||
//What to do on init
|
||||
void TMyApplication::InnerInit()
|
||||
{
|
||||
@ -134,6 +172,7 @@ void TMyApplication::InnerInit()
|
||||
ResourceManager->ShaderManager.AddShader("Parallax", "shaders/directlight_parallax_shadow.vertex", "shaders/directlight_parallax_shadow.fragment");
|
||||
ResourceManager->ShaderManager.AddShader("Directlight", "shaders/directlight.vertex", "shaders/directlight.fragment");
|
||||
ResourceManager->ShaderManager.AddShader("Env", "shaders/env.vertex", "shaders/env.fragment");
|
||||
ResourceManager->ShaderManager.AddShader("EnvReverse", "shaders/env_reverse.vertex", "shaders/env_reverse.fragment");
|
||||
ResourceManager->ShaderManager.AddShader("Water", "shaders/water.vertex", "shaders/water.fragment");
|
||||
ResourceManager->ShaderManager.AddShader("Frame", "shaders/frame.vertex", "shaders/frame.fragment");
|
||||
ResourceManager->ShaderManager.AddShader("Lightview", "shaders/lightview.vertex", "shaders/lightview.fragment");
|
||||
@ -168,17 +207,31 @@ void TMyApplication::InnerInit()
|
||||
|
||||
//ResourceManager->LightManager.SetLightPos(0, vec4(-len * cos(pi/4), len * sin(pi/4), 0.0f, 0.0f));
|
||||
|
||||
ResourceManager->FrameManager.AddCubemapBuffer("Skybox",256,256);
|
||||
ResourceManager->FrameManager.AddCubemapBuffer("Skybox",512,512);
|
||||
|
||||
Renderer->SetBackgroundCubemap(ResourceManager->FrameManager.GetFrameTexture("Skybox"));
|
||||
|
||||
ResourceManager->TexList.AddTexture("../resources/normalmap.bmp");
|
||||
|
||||
std::array<std::string, 6> cubemapTextureStr = {
|
||||
"../resources/posx.bmp", "../resources/negx.bmp", "../resources/posy.bmp", "../resources/negy.bmp", "../resources/posz.bmp", "../resources/negz.bmp"
|
||||
"../resources/sky/posx.bmp", "../resources/sky/negx.bmp", "../resources/sky/posy.bmp", "../resources/sky/negy.bmp", "../resources/sky/posz.bmp", "../resources/sky/negz.bmp"
|
||||
};
|
||||
|
||||
cubemapTexture = ResourceManager->TexList.AddCubemapTexture(cubemapTextureStr);
|
||||
|
||||
//!!!! for some reason up and down switched
|
||||
std::array<std::string, 6> cubemapTextureDayStr = {
|
||||
"../resources/sky/yavin_rt.bmp", "../resources/sky/yavin_lf.bmp", "../resources/sky/yavin_dn.bmp", "../resources/sky/yavin_up.bmp", "../resources/sky/yavin_bk.bmp", "../resources/sky/yavin_ft.bmp"
|
||||
};
|
||||
|
||||
|
||||
cubemapTextureDay = ResourceManager->TexList.AddCubemapTexture(cubemapTextureDayStr);
|
||||
|
||||
std::array<std::string, 6> cubemapTextureNightStr = {
|
||||
"../resources/sky/space_rt.bmp", "../resources/sky/space_lf.bmp", "../resources/sky/space_up.bmp", "../resources/sky/space_dn.bmp", "../resources/sky/space_bk.bmp", "../resources/sky/space_ft.bmp"
|
||||
};
|
||||
|
||||
cubemapTextureNight = ResourceManager->TexList.AddCubemapTexture(cubemapTextureNightStr);
|
||||
//."posx.bmp","negx.bmp","posy.bmp","negy.bmp","posz.bmp","negz.bmp"
|
||||
|
||||
ResourceManager->FrameManager.AddFrameRenderBuffer("ScreenBlur", 512, 512);
|
||||
@ -358,15 +411,17 @@ void TMyApplication::InnerDraw()
|
||||
|
||||
|
||||
Renderer->PushShader("Directlight");
|
||||
//DrawCubemapDay();
|
||||
|
||||
DrawToCubemap();
|
||||
|
||||
//Renderer->SwitchToCubemapBuffer("Skybox", 0);
|
||||
//Renderer->SetGlPosXView();
|
||||
//DrawSceneWithoutWater();
|
||||
|
||||
DrawSceneWithoutWater();
|
||||
|
||||
//DrawCubemap();
|
||||
|
||||
/*
|
||||
if (view % 3 == 0)
|
||||
{
|
||||
//DrawCubemap();
|
||||
@ -380,12 +435,12 @@ void TMyApplication::InnerDraw()
|
||||
else
|
||||
{
|
||||
DrawSceneWithoutWater();
|
||||
}
|
||||
}*/
|
||||
|
||||
Renderer->PopShader();
|
||||
|
||||
|
||||
//DrawWaterSurface();
|
||||
DrawWaterSurface();
|
||||
|
||||
|
||||
/*
|
||||
|
@ -39,15 +39,21 @@ class TMyApplication : public SE::TApplication
|
||||
void DrawWaterSurface();
|
||||
|
||||
void DrawCubemap();
|
||||
void DrawCubemapDay();
|
||||
|
||||
cardinal cubemapTexture;
|
||||
cardinal cubemapTextureDay;
|
||||
cardinal cubemapTextureNight;
|
||||
VertexDataStruct cubemapVertexDataStruct;
|
||||
VertexDataStruct waterVertexDataStruct;
|
||||
|
||||
public:
|
||||
|
||||
//Constructor
|
||||
TMyApplication() : MouseRightButtonPressed(false), MouseLeftButtonPressed(false), WaterTimer(0) { }
|
||||
TMyApplication() : MouseRightButtonPressed(false), MouseLeftButtonPressed(false), WaterTimer(0) {
|
||||
Width = 1920;
|
||||
Height = 1080;
|
||||
}
|
||||
|
||||
virtual void InnerInit();
|
||||
//What to do on init
|
||||
|
21
resources/shaders/env_reverse.fragment
Normal file
@ -0,0 +1,21 @@
|
||||
uniform samplerCube Env;
|
||||
|
||||
varying vec3 dir;
|
||||
|
||||
void main(){
|
||||
gl_FragColor = textureCube(Env, normalize(dir));
|
||||
|
||||
vec4 fogColor = vec4(0.25, 0.55, 1.0, 1.0);
|
||||
|
||||
float coef = dir.y+1.0;
|
||||
coef = clamp(coef, 0.0, 1.0);
|
||||
|
||||
gl_FragColor = mix(gl_FragColor,fogColor, coef);
|
||||
|
||||
//if (dir.z < 0)
|
||||
//{
|
||||
// gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
//}
|
||||
//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
}
|
14
resources/shaders/env_reverse.vertex
Normal file
@ -0,0 +1,14 @@
|
||||
attribute vec3 vPosition;
|
||||
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat3 ModelRotateMatrix;
|
||||
uniform vec3 ModelTranslateVector;
|
||||
|
||||
varying vec3 dir;
|
||||
|
||||
void main(){
|
||||
vec4 realVertexPos = vec4(ModelRotateMatrix * vPosition.xyz + ModelTranslateVector, 1.0);
|
||||
gl_Position = ProjectionMatrix * realVertexPos;
|
||||
|
||||
dir = -vPosition;
|
||||
}
|
@ -13,11 +13,13 @@ void main()
|
||||
{
|
||||
vec3 camVec2 = normalize(camVec);
|
||||
|
||||
/*camVec2.y = -camVec2.y;
|
||||
|
||||
vec4 reflectColor = textureCube(Env, camVec2);
|
||||
|
||||
gl_FragColor = vec4(reflectColor.xyz, 1.0f);
|
||||
*/
|
||||
|
||||
/*
|
||||
mat3 rot;
|
||||
|
||||
rot[0] = vec3(0.0,0.0,1.0);
|
||||
@ -44,9 +46,9 @@ void main()
|
||||
vec4 reflectColor = textureCube(Env, dir1);
|
||||
vec4 refractColor = textureCube(Env, dir2);
|
||||
|
||||
vec4 texColor = reflectColor*0.2 + refractColor*0.8;
|
||||
vec4 texColor = reflectColor*0.5 + refractColor*0.5;
|
||||
|
||||
gl_FragColor = vec4(texColor.xyz, 1.0f);*/
|
||||
gl_FragColor = vec4(texColor.xyz, 1.0f);
|
||||
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@ void main()
|
||||
|
||||
texCoord = vTexCoord;
|
||||
|
||||
camVec = -(vPosition.xyz - CamPos);
|
||||
camVec = (vPosition.xyz - CamPos);
|
||||
|
||||
//camVec = vec3(0, 1, 0);
|
||||
|
||||
|
Before Width: | Height: | Size: 768 KiB After Width: | Height: | Size: 768 KiB |
Before Width: | Height: | Size: 768 KiB After Width: | Height: | Size: 768 KiB |
Before Width: | Height: | Size: 768 KiB After Width: | Height: | Size: 768 KiB |
Before Width: | Height: | Size: 768 KiB After Width: | Height: | Size: 768 KiB |
Before Width: | Height: | Size: 768 KiB After Width: | Height: | Size: 768 KiB |
Before Width: | Height: | Size: 768 KiB After Width: | Height: | Size: 768 KiB |
BIN
resources/sky/space_bk.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/space_dn.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/space_ft.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/space_lf.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/space_rt.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/space_up.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/yavin_bk.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/yavin_dn.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/yavin_ft.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/yavin_lf.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/yavin_rt.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
resources/sky/yavin_up.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |