Skip to content

Commit

Permalink
default hdri
Browse files Browse the repository at this point in the history
  • Loading branch information
furkansarihan committed Mar 6, 2024
1 parent 0bc8379 commit b6f27ae
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 41 deletions.
20 changes: 18 additions & 2 deletions dev/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,28 @@ int main()
SoundEngine *soundEngine = enigine.soundEngine;
Camera *mainCamera = enigine.mainCamera;

// environment map
std::string path = resourceManager->m_executablePath + "/assets/hdr_skybox/skybox-7.hdr";
// set environment map
std::string path = resourceManager->m_executablePath + "/assets/hdris/qwantani_puresky.hdr";
TextureParams textureParams;
textureParams.dataType = TextureDataType::Float32;
Texture envTexture = resourceManager->textureFromFile(textureParams, path, path);
renderManager->updateEnvironmentTexture(envTexture);
renderManager->m_shadowManager->m_lightPos = glm::normalize(glm::vec3(0.693f, 0.51f, 0.51f));

// add render source
std::string modelPath = resourceManager->m_executablePath + "/assets/models/rim.glb";
Model *rimModel = resourceManager->getModelFullPath(modelPath);
eTransform transform;
transform.setScale(glm::vec3(2.f));
RenderSource *rimSource = RenderSourceBuilder()
.setTransform(transform)
.setModel(rimModel)
.build();
renderManager->addSource(rimSource);

// update camera
mainCamera->position = glm::vec3(-2.f, 0.f, 2.f);
mainCamera->front = glm::vec3(0.707f, 0.f, -0.707f);

enigine.start();

Expand Down
6 changes: 6 additions & 0 deletions src/assets/hdris/qwantani_puresky.hdr

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/assets/models/cube.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Blender v3.0.0 OBJ File: ''
# www.blender.org
o Cube
o cube
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
Expand Down
4 changes: 1 addition & 3 deletions src/assets/models/cylinder.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Blender v3.6.4 OBJ File: ''
# www.blender.org
o Cylinder
o cylinder
v 0.000000 -0.500000 -0.500000
v 0.000000 0.500000 -0.500000
v 0.191342 -0.500000 -0.461940
Expand Down
54 changes: 27 additions & 27 deletions src/assets/models/icosahedron.obj
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# icosahedron.obj
g icosahedron
o icosahedron
v 0.000000 -0.525731 0.850651
v 0.850651 0.000000 0.525731
v 0.850651 0.000000 -0.525731
v -0.850651 0.000000 -0.525731
v 0.850651 -0.000000 -0.525731
v -0.850651 -0.000000 -0.525731
v -0.850651 0.000000 0.525731
v -0.525731 0.850651 0.000000
v 0.525731 0.850651 0.000000
v -0.525731 0.850651 -0.000000
v 0.525731 0.850651 -0.000000
v 0.525731 -0.850651 0.000000
v -0.525731 -0.850651 0.000000
v 0.000000 -0.525731 -0.850651
v 0.000000 0.525731 -0.850651
v 0.000000 0.525731 0.850651
vn 0.934172 0.356822 0.000000
vn 0.934172 -0.356822 0.000000
vn -0.934172 0.356822 0.000000
vn -0.934172 -0.356822 0.000000
vn 0.000000 0.934172 0.356822
vn 0.000000 0.934172 -0.356822
vn 0.356822 0.000000 -0.934172
vn -0.356822 0.000000 -0.934172
vn 0.000000 -0.934172 -0.356822
vn 0.000000 -0.934172 0.356822
vn 0.356822 0.000000 0.934172
vn -0.356822 0.000000 0.934172
vn 0.577350 0.577350 -0.577350
vn 0.577350 0.577350 0.577350
vn -0.577350 0.577350 -0.577350
vn -0.577350 0.577350 0.577350
vn 0.577350 -0.577350 -0.577350
vn 0.577350 -0.577350 0.577350
vn -0.577350 -0.577350 -0.577350
vn -0.577350 -0.577350 0.577350
vn 0.9342 0.3568 -0.0000
vn 0.9342 -0.3568 -0.0000
vn -0.9342 0.3568 -0.0000
vn -0.9342 -0.3568 -0.0000
vn -0.0000 0.9342 0.3568
vn -0.0000 0.9342 -0.3568
vn 0.3568 -0.0000 -0.9342
vn -0.3568 -0.0000 -0.9342
vn -0.0000 -0.9342 -0.3568
vn -0.0000 -0.9342 0.3568
vn 0.3568 -0.0000 0.9342
vn -0.3568 -0.0000 0.9342
vn 0.5774 0.5774 -0.5774
vn 0.5774 0.5774 0.5774
vn -0.5774 0.5774 -0.5774
vn -0.5774 0.5774 0.5774
vn 0.5774 -0.5774 -0.5774
vn 0.5774 -0.5774 0.5774
vn -0.5774 -0.5774 -0.5774
vn -0.5774 -0.5774 0.5774
s 0
f 2//1 3//1 7//1
f 2//2 8//2 3//2
f 4//3 5//3 6//3
Expand All @@ -51,4 +51,4 @@ f 6//16 5//16 12//16
f 3//17 8//17 10//17
f 8//18 2//18 1//18
f 4//19 10//19 9//19
f 5//20 9//20 1//20
f 5//20 9//20 1//20
4 changes: 1 addition & 3 deletions src/assets/models/quad.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Blender 3.4.1
# www.blender.org
o Plane
o quad
v 0.000000 1.000000 1.000000
v -0.000000 -1.000000 1.000000
v 0.000000 1.000000 -1.000000
Expand Down
Binary file added src/assets/models/rim.glb
Binary file not shown.
4 changes: 1 addition & 3 deletions src/assets/models/sphere.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Blender 3.4.1
# www.blender.org
o Sphere
o sphere
v 0.000000 0.773010 -0.634393
v 0.000000 0.634393 -0.773010
v 0.000000 0.382683 -0.923880
Expand Down

0 comments on commit b6f27ae

Please sign in to comment.