Compare commits

...

3 Commits

Author SHA1 Message Date
Vladislav Khorev
11398507e3 Set switch between day and light 2024-06-10 22:49:24 +03:00
Vladislav Khorev
73839b05d9 Now bump mapping wors 2024-06-10 22:17:41 +03:00
Vladislav Khorev
7fc9a5e5d6 light working 2024-06-09 21:42:23 +03:00
11 changed files with 477 additions and 114 deletions

View File

@ -105,10 +105,11 @@ void TGameMap::LoadMap()
Land->SetTexture(std::string("landscapes/out.bmp"));
Land->Scale(0.005f);
StaticModelArr.resize(3);
StaticModelArr.resize(4);
StaticModelArr[0].LoadModel("bt_box_yellow.lm1");
StaticModelArr[1].LoadModel("bt_box_red.lm1");
StaticModelArr[2].LoadModel("bt_box_blue.lm1");
StaticModelArr[3].LoadModel("bt_box_yellow.lm1");
StaticModelArr[0].ScaleModel(2.0);
StaticModelArr[0].RotateModel(mat3(vec4(0.0, sin(pi/6), 0.0, cos(pi/6))));
@ -122,11 +123,14 @@ void TGameMap::LoadMap()
StaticModelArr[2].ScaleModel(2.0);
StaticModelArr[2].MoveModel(vec3(-1.5f, 0.23f, 7.8f));
StaticModelArr[3].ScaleModel(2.0);
StaticModelArr[3].MoveModel(vec3(0.f, 0.4f, 0.f));
StaticModelArr[0].UpdateVBO();
StaticModelArr[1].UpdateVBO();
StaticModelArr[2].UpdateVBO();
StaticModelArr[3].UpdateVBO();
//StaticModelArr[0].SetShaderTranslateVector(vec3(-1.0f, 0.23f, 6.3f));
PlayerChar = new TLiteModel;
@ -147,6 +151,7 @@ void TGameMap::LoadMap()
MapChar.SetPos(vec3(0.0f, 0.0f, 10.0f));
day = false;
}
@ -188,13 +193,22 @@ TSimpleLandClass* TGameMap::GetLand()
void TGameMap::DrawVBO()
{
Land->DrawVBO();
if (day)
{
Renderer->PushShader("Directlight");
}
else
{
Renderer->PushShader("Directlight3");
}
for (TLiteModelArr::iterator i = StaticModelArr.begin(); i != StaticModelArr.end(); ++i)
{
//i->DrawImmediate();
i->DrawVBO();
}
Renderer->PopShader();
//PlayerChar->DrawVBO();
@ -209,6 +223,15 @@ cardinal timeForSeq = 0;
void TGameMap::Update(cardinal timer)
{
vec4 quat = vec4(0, sin(timer / 2000.f), 0, cos(timer / 2000.f));
mat3 rotate(quat);
StaticModelArr[3].RotateModel(rotate);
StaticModelArr[3].UpdateVBO();
/*
MapChar.Update(timer);
@ -238,7 +261,7 @@ void TGameMap::Update(cardinal timer)
//GirlText->ApplySequence("girl.an1", animSeq);
//GirlText->UpdateVBO();
}
}
}*/

View File

@ -62,5 +62,6 @@ public:
TAnimModel* AnimModel;
TAnimModel* GirlText;
int animSeq;
bool day;
};

View File

@ -1,139 +1,169 @@
2024-Jun-09 10:36:12: Log started
2024-Jun-09 10:36:13: OpenGL Window created
2024-Jun-09 10:36:13: Script manager ready
2024-Jun-09 10:36:13: Render::OpenGL glVersion = 4.6.0 - Build 31.0.101.4887
2024-Jun-09 10:36:13: Render::OpenGL glVersion above 2.0 ok
2024-Jun-09 10:36:13: Render::OpenGL GL_ARB_framebuffer_object supported ok
2024-Jun-09 10:36:13: Render::OpenGL GL_ARB_uniform_buffer_object supported ok
2024-Jun-09 10:36:13: Prepare to add shader GUI
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Log started
2024-Jun-10 22:47:04: OpenGL Window created
2024-Jun-10 22:47:04: Script manager ready
2024-Jun-10 22:47:04: Render::OpenGL glVersion = 4.6.0 - Build 31.0.101.4887
2024-Jun-10 22:47:04: Render::OpenGL glVersion above 2.0 ok
2024-Jun-10 22:47:04: Render::OpenGL GL_ARB_framebuffer_object supported ok
2024-Jun-10 22:47:04: Render::OpenGL GL_ARB_uniform_buffer_object supported ok
2024-Jun-10 22:47:04: Prepare to add shader GUI
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: Shader program is - 3
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: GUI
2024-Jun-09 10:36:13: Prepare to add shader Parallax
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 3
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: GUI
2024-Jun-10 22:47:04: Prepare to add shader Parallax
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: 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-09 10:36:13: Shader program is - 6
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: Parallax
2024-Jun-09 10:36:13: Prepare to add shader Directlight
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 6
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Parallax
2024-Jun-10 22:47:04: Prepare to add shader Directlight
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: Shader program is - 9
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: Directlight
2024-Jun-09 10:36:13: Prepare to add shader Env
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 9
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Directlight
2024-Jun-10 22:47:04: Prepare to add shader Directlight2
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: Shader program is - 12
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: Env
2024-Jun-09 10:36:13: Prepare to add shader EnvReverse
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 12
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Directlight2
2024-Jun-10 22:47:04: Prepare to add shader Directlight3
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: Shader program is - 15
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: EnvReverse
2024-Jun-09 10:36:13: Prepare to add shader Water
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 15
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Directlight3
2024-Jun-10 22:47:04: Prepare to add shader Env
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 18
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Env
2024-Jun-10 22:47:04: Prepare to add shader EnvReverse
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 21
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: EnvReverse
2024-Jun-10 22:47:04: Prepare to add shader EnvReverseNight
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 24
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: EnvReverseNight
2024-Jun-10 22:47:04: Prepare to add shader Water
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
WARNING: 0:29: 'assign' : implicit type conversion allowed from GLSL 1.20
2024-Jun-09 10:36:13: Shader program is - 18
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: Water
2024-Jun-09 10:36:13: Prepare to add shader Frame
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 27
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Water
2024-Jun-10 22:47:04: Prepare to add shader Frame
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: Shader program is - 21
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: Frame
2024-Jun-09 10:36:13: Prepare to add shader Lightview
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:5: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 30
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Frame
2024-Jun-10 22:47:04: Prepare to add shader Lightview
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:5: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: Shader program is - 24
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: Lightview
2024-Jun-09 10:36:13: Prepare to add shader Simple3D
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: Shader program is - 33
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Lightview
2024-Jun-10 22:47:04: Prepare to add shader Simple3D
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader WARNING: 0:1: '' : #version directive missing
2024-Jun-09 10:36:13: Shader program is - 27
2024-Jun-09 10:36:13: ResourceManager::ShaderManager::Shader
2024-Jun-09 10:36:13: ResourceManager::ShaderManager shader loaded: Simple3D
2024-Jun-09 10:36:13: ResourceManager::TexList Texture added: bt_box_yellow.bmp with id = 1
2024-Jun-09 10:36:13: ResourceManager::TexList Texture added: bt_box_norm.bmp32 with id = 2
2024-Jun-09 10:36:13: Lite model added successfully: models/bt_box_yellow.lm1
2024-Jun-09 10:36:13: ResourceManager::TexList Texture added: bt_box_red000.bmp with id = 3
2024-Jun-09 10:36:13: ResourceManager::TexList Texture reference added: bt_box_norm.bmp32
2024-Jun-09 10:36:13: Lite model added successfully: models/bt_box_red.lm1
2024-Jun-09 10:36:13: ResourceManager::TexList Texture added: bt_box_blue00.bmp with id = 4
2024-Jun-09 10:36:13: ResourceManager::TexList Texture reference added: bt_box_norm.bmp32
2024-Jun-09 10:36:13: Lite model added successfully: models/bt_box_blue.lm1
2024-Jun-09 10:36:13: ResourceManager::TexList Texture added: bt_cone.bmp with id = 5
2024-Jun-09 10:36:13: Lite model added successfully: models/bt_cone.lm1
2024-Jun-09 10:36:13: Lite model added successfully: models/girl.lm1
2024-Jun-09 10:36:14: Lite model added successfully: models/bonemodel.lm1
2024-Jun-09 10:36:16: ResourceManager::TexList Texture added: out.bmp with id = 6
2024-Jun-09 10:36:16: FrameManager:: frame buffer added: Skybox
2024-Jun-09 10:36:16: ResourceManager::TexList Texture added: normalmap.bmp with id = 8
2024-Jun-09 10:36:16: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posx.bmp
2024-Jun-09 10:36:16: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negx.bmp
2024-Jun-09 10:36:17: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posy.bmp
2024-Jun-09 10:36:17: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negy.bmp
2024-Jun-09 10:36:17: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posz.bmp
2024-Jun-09 10:36:17: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negz.bmp
2024-Jun-09 10:36:17: ResourceManager::TexList texture added succesfuly: posx.bmp
2024-Jun-09 10:36:17: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_rt.bmp
2024-Jun-09 10:36:17: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_lf.bmp
2024-Jun-09 10:36:17: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_dn.bmp
2024-Jun-09 10:36:17: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_up.bmp
2024-Jun-09 10:36:18: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_bk.bmp
2024-Jun-09 10:36:18: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_ft.bmp
2024-Jun-09 10:36:18: ResourceManager::TexList texture added succesfuly: yavin_rt.bmp
2024-Jun-09 10:36:18: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_rt.bmp
2024-Jun-09 10:36:18: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_lf.bmp
2024-Jun-09 10:36:19: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_up.bmp
2024-Jun-09 10:36:19: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_dn.bmp
2024-Jun-09 10:36:19: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_bk.bmp
2024-Jun-09 10:36:19: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_ft.bmp
2024-Jun-09 10:36:20: ResourceManager::TexList texture added succesfuly: space_rt.bmp
2024-Jun-09 10:36:20: FrameManager:: frame buffer added: ScreenBlur
2024-Jun-09 10:36:20: FrameManager:: frame buffer added: ShadowBufferGlobal
2024-Jun-09 10:36:20: FrameManager:: frame buffer added: ShadowBufferLocal
2024-Jun-10 22:47:04: Shader program is - 36
2024-Jun-10 22:47:04: ResourceManager::ShaderManager::Shader
2024-Jun-10 22:47:04: ResourceManager::ShaderManager shader loaded: Simple3D
2024-Jun-10 22:47:04: ResourceManager::TexList Texture added: bt_box_yellow.bmp with id = 1
2024-Jun-10 22:47:04: ResourceManager::TexList Texture added: bt_box_norm.bmp32 with id = 2
2024-Jun-10 22:47:04: Lite model added successfully: models/bt_box_yellow.lm1
2024-Jun-10 22:47:04: ResourceManager::TexList Texture added: bt_box_red000.bmp with id = 3
2024-Jun-10 22:47:04: ResourceManager::TexList Texture reference added: bt_box_norm.bmp32
2024-Jun-10 22:47:04: Lite model added successfully: models/bt_box_red.lm1
2024-Jun-10 22:47:04: ResourceManager::TexList Texture added: bt_box_blue00.bmp with id = 4
2024-Jun-10 22:47:04: ResourceManager::TexList Texture reference added: bt_box_norm.bmp32
2024-Jun-10 22:47:04: Lite model added successfully: models/bt_box_blue.lm1
2024-Jun-10 22:47:04: ResourceManager::TexList Texture added: bt_cone.bmp with id = 5
2024-Jun-10 22:47:04: Lite model added successfully: models/bt_cone.lm1
2024-Jun-10 22:47:04: Lite model added successfully: models/girl.lm1
2024-Jun-10 22:47:05: Lite model added successfully: models/bonemodel.lm1
2024-Jun-10 22:47:06: ResourceManager::TexList Texture added: out.bmp with id = 6
2024-Jun-10 22:47:06: FrameManager:: frame buffer added: Skybox
2024-Jun-10 22:47:06: ResourceManager::TexList Texture added: normalmap.bmp with id = 8
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posx.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negx.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posy.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negy.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/posz.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/negz.bmp
2024-Jun-10 22:47:07: ResourceManager::TexList texture added succesfuly: posx.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_rt.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_lf.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_dn.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_up.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_bk.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/yavin_ft.bmp
2024-Jun-10 22:47:07: ResourceManager::TexList texture added succesfuly: yavin_rt.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_rt.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_lf.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_up.bmp
2024-Jun-10 22:47:07: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_dn.bmp
2024-Jun-10 22:47:08: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_bk.bmp
2024-Jun-10 22:47:08: Going to add texture: C:\Work\OldProjects\ho3\resources\../resources/sky/space_ft.bmp
2024-Jun-10 22:47:08: ResourceManager::TexList texture added succesfuly: space_rt.bmp
2024-Jun-10 22:47:08: FrameManager:: frame buffer added: ScreenBlur
2024-Jun-10 22:47:08: FrameManager:: frame buffer added: ShadowBufferGlobal
2024-Jun-10 22:47:08: FrameManager:: frame buffer added: ShadowBufferLocal

View File

@ -14,53 +14,104 @@ void TMyApplication::DrawToCubemap()
Renderer->SwitchToCubemapBuffer("Skybox",0);
Renderer->SetGlPosXView(false, true);
DrawCubemapDay();
DrawCubemap();
if (day)
{
Renderer->PushShader("Directlight");
}
else
{
Renderer->PushShader("Directlight2");
}
Renderer->SetGlPosXView(true, true);
GameMap.DrawVBO();
Renderer->PopShader();
//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(false, true);
DrawCubemapDay();
DrawCubemap();
if (day)
{
Renderer->PushShader("Directlight");
}
else
{
Renderer->PushShader("Directlight2");
}
Renderer->SetGlNegXView(true, true);
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
GameMap.DrawVBO();
Renderer->PopShader();
Renderer->SwitchToCubemapBuffer("Skybox",2);
Renderer->SetGlPosYView(false, true);
DrawCubemapDay();
DrawCubemap();
if (day)
{
Renderer->PushShader("Directlight");
}
else
{
Renderer->PushShader("Directlight2");
}
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->PopShader();
Renderer->SwitchToCubemapBuffer("Skybox",3);
Renderer->SetGlNegYView(false, true);
DrawCubemapDay();
DrawCubemap();
if (day)
{
Renderer->PushShader("Directlight");
}
else
{
Renderer->PushShader("Directlight2");
}
Renderer->SetGlNegYView(true, true);
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
GameMap.DrawVBO();
Renderer->PopShader();
Renderer->SwitchToCubemapBuffer("Skybox",4);
Renderer->SetGlPosZView(false, true);
DrawCubemapDay();
DrawCubemap();
if (day)
{
Renderer->PushShader("Directlight");
}
else
{
Renderer->PushShader("Directlight2");
}
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->PopShader();
Renderer->SwitchToCubemapBuffer("Skybox",5);
Renderer->SetGlNegZView(false, true);
DrawCubemapDay();
DrawCubemap();
if (day)
{
Renderer->PushShader("Directlight");
}
else
{
Renderer->PushShader("Directlight2");
}
Renderer->SetGlNegZView(true, true);
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
//glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
GameMap.DrawVBO();
Renderer->PopShader();
Renderer->SwitchToScreen();
@ -84,9 +135,18 @@ void TMyApplication::DrawToShadowMap()
void TMyApplication::DrawSceneWithoutWater()
{
Renderer->SetGLCamAngleView();
DrawCubemapDay();
DrawCubemap();
if (day)
{
Renderer->PushShader("Directlight");
}
else
{
Renderer->PushShader("Directlight2");
}
Renderer->SetGLCamView();
GameMap.DrawVBO();
Renderer->PopShader();
}
void TMyApplication::DrawWaterSurface()
@ -117,6 +177,18 @@ void TMyApplication::DrawWaterSurface()
}
void TMyApplication::DrawCubemap()
{
if (day)
{
DrawCubemapDay();
}
else
{
DrawCubemapNight();
}
}
void TMyApplication::DrawCubemapFixed()
{
Renderer->PushShader("Env");
//Renderer->SetGLCamAngleView();
@ -160,6 +232,30 @@ void TMyApplication::DrawCubemapDay()
Renderer->PopShader();
}
void TMyApplication::DrawCubemapNight()
{
Renderer->PushShader("EnvReverseNight");
//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, cubemapTextureNight);
EnableVertexAttribArray("vPosition");
DrawVertexDataStruct(cubemapVertexDataStruct);
DisableVertexAttribArray("vPosition");
glClear(GL_DEPTH_BUFFER_BIT);
Renderer->PopShader();
}
void TMyApplication::DrawFrameFullScreen()
{
@ -176,8 +272,11 @@ void TMyApplication::InnerInit()
ResourceManager->ShaderManager.AddShader("GUI", "shaders/gui_transparent.vertex", "shaders/gui_transparent.fragment");
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("Directlight2", "shaders/directlight2.vertex", "shaders/directlight2.fragment");
ResourceManager->ShaderManager.AddShader("Directlight3", "shaders/directlight3.vertex", "shaders/directlight3.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("EnvReverseNight", "shaders/env_reverse_night.vertex", "shaders/env_reverse_night.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");
@ -417,6 +516,9 @@ void TMyApplication::InnerInit()
frameVertexDataStruct.TexCoordData.push_back({ 0.0, 1.0 });
frameVertexDataStruct.RefreshVBO();
day = false;
GameMap.day = day;
}
@ -434,7 +536,14 @@ void TMyApplication::InnerDraw()
glClearColor(0.2f, 0.55f, 1.0f, 1.0f);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
if (day)
{
}
else
{
Renderer->SetLightPos(lightPos);
}
Renderer->PushShader("Directlight");
//DrawCubemapDay();
@ -525,6 +634,8 @@ void TMyApplication::InnerUpdate(cardinal timer)
{
WaterTimer += 0.001f * timer;
lightPos = vec3(sin(WaterTimer) * 4.f-2, 5, 0);
GameMap.Update(timer);
}

View File

@ -28,6 +28,10 @@ class TMyApplication : public SE::TApplication
int view = 0;
vec3 lightPos;
bool day = false;
float WaterTimer;
void DrawSceneWithoutWater();
@ -38,8 +42,10 @@ class TMyApplication : public SE::TApplication
void DrawWaterSurface();
void DrawCubemapFixed();
void DrawCubemap();
void DrawCubemapDay();
void DrawCubemapNight();
void DrawFrameFullScreen();

View File

@ -0,0 +1,46 @@
uniform sampler2D Texture;
uniform float FogBeginDistance;
uniform float FogEndDistance;
varying vec2 texCoord;
varying vec3 vertexPos;
varying vec3 normal;
varying vec3 absoluteVertexPos;
void main()
{
//vec3 norm = normalize(normal)*0.5 + vec3(0.5, 0.5, 0.5);
//gl_FragColor = vec4(norm, 1.0);
vec3 norm = normalize(normal);
vec3 lightPos = vec3(-2, 5, 0);
vec3 lightVec = absoluteVertexPos - lightPos;
float coef = max(dot(-normalize(lightVec),norm),0.2);
float coef2 = clamp((15.0 - length(lightVec))/10.0, 0.2, 1.0);
vec4 texColor = texture2D(Texture,texCoord).rgba;
gl_FragColor = vec4(texColor.rgb*coef2*coef, 1.0);
/*
//Night
//vec4 fogColor = vec4(0.25, 0.55, 1.0, 1.0);
vec4 fogColor = vec4(0.05, 0.05, 0.1, 1.0);
float fogDistCoef = (vertexPos.z - FogBeginDistance) / (FogEndDistance - FogBeginDistance);
fogDistCoef = clamp(fogDistCoef, 0.0, 1.0);
vec4 resultColor = mix(texColor*coef2, fogColor, fogDistCoef);
gl_FragColor = vec4(resultColor.rgb, 1.0);*/
}

View File

@ -0,0 +1,26 @@
attribute vec3 vPosition;
attribute vec2 vTexCoord;
attribute vec3 vNormal;
uniform mat4 ProjectionMatrix;
uniform mat3 ModelRotateMatrix;
uniform vec3 ModelTranslateVector;
varying vec2 texCoord;
varying vec3 vertexPos;
varying vec3 absoluteVertexPos;
varying vec3 normal;
void main()
{
vec4 realVertexPos = vec4(ModelRotateMatrix * vPosition.xyz + ModelTranslateVector, 1.0);
gl_Position = ProjectionMatrix * realVertexPos;
vertexPos = gl_Position.xyz;
absoluteVertexPos = vPosition;
texCoord = vTexCoord.st;
normal = vNormal;
}

View File

@ -0,0 +1,54 @@
uniform sampler2D Texture;
uniform sampler2D NormalMap;
uniform float FogBeginDistance;
uniform float FogEndDistance;
varying vec2 texCoord;
varying vec3 vertexPos;
varying vec3 absoluteVertexPos;
varying vec3 normal;
varying vec3 tangent;
varying vec3 bitangent;
void main()
{
vec3 norm1 = normalize(normal);
vec3 norm2 = texture2D(NormalMap, texCoord).rgb * 2.0 - 1.0;
mat3 TBN = mat3(tangent, bitangent, norm1);
vec3 transformedNormal = normalize(TBN * norm2);
//gl_FragColor = vec4(transformedNormal*0.5+ vec3(0.5, 0.5, 0.5), 1.0);
vec3 lightPos = vec3(-2, 5, 0);
vec3 lightVec = absoluteVertexPos - lightPos;
float coef = max(dot(-normalize(lightVec),transformedNormal),0.2);
float coef2 = clamp((15.0 - length(lightVec))/10.0, 0.2, 1.0);
vec4 texColor = texture2D(Texture,texCoord).rgba;
gl_FragColor = vec4(texColor.rgb*coef2*coef, 1.0);
/*
//Night
//vec4 fogColor = vec4(0.25, 0.55, 1.0, 1.0);
vec4 fogColor = vec4(0.05, 0.05, 0.1, 1.0);
float fogDistCoef = (vertexPos.z - FogBeginDistance) / (FogEndDistance - FogBeginDistance);
fogDistCoef = clamp(fogDistCoef, 0.0, 1.0);
vec4 resultColor = mix(texColor*coef2, fogColor, fogDistCoef);
gl_FragColor = vec4(resultColor.rgb, 1.0);*/
}

View File

@ -0,0 +1,31 @@
attribute vec3 vPosition;
attribute vec2 vTexCoord;
attribute vec3 vNormal;
attribute vec3 vTangent;
attribute vec3 vBinormal;
uniform mat4 ProjectionMatrix;
uniform mat3 ModelRotateMatrix;
uniform vec3 ModelTranslateVector;
varying vec2 texCoord;
varying vec3 vertexPos;
varying vec3 absoluteVertexPos;
varying vec3 normal;
varying vec3 tangent;
varying vec3 bitangent;
void main()
{
vec4 realVertexPos = vec4(ModelRotateMatrix * vPosition.xyz + ModelTranslateVector, 1.0);
gl_Position = ProjectionMatrix * realVertexPos;
vertexPos = gl_Position.xyz;
absoluteVertexPos = vPosition;
texCoord = vTexCoord.st;
normal = normalize(vNormal);
tangent = normalize(vTangent);
bitangent = cross(normal, tangent);
}

View File

@ -0,0 +1,21 @@
uniform samplerCube Env;
varying vec3 dir;
void main(){
gl_FragColor = textureCube(Env, normalize(dir));
vec4 fogColor = vec4(0.05, 0.05, 0.1, 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);
}

View 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;
}