Skip to content

Commit

Permalink
IBL start.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Dubouchet committed Apr 3, 2023
1 parent 8d52c70 commit 371e893
Show file tree
Hide file tree
Showing 20 changed files with 335 additions and 197 deletions.
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Attach",
"type": "cppvsdbg",
"request": "attach",
}
],
"env": {
"VCPKG_ROOT": "/Users/fdubouchet/Documents/GitHub/vcpkg"
}
}
200 changes: 200 additions & 0 deletions asset/json/image_based_lighting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"name": "LastMonsterStanding",
"default_texture_name": "albedo",
"textures": [
{
"name": "albedo",
"size": {
"x": -1,
"y": -1
},
"pixel_element_size": { "value": "BYTE" },
"pixel_structure": { "value": "RGB" }
},
{
"name": "skybox",
"cubemap": "true",
"pixel_element_size": { "value": "FLOAT" },
"pixel_structure": { "value": "RGB" },
"file_name": "asset/cubemap/hamarikyu.hdr"
},
{
"name": "apple_texture",
"cubemap": false,
"pixel_element_size": { "value": "BYTE" },
"pixel_structure": { "value": "RGB" },
"file_name": "asset/apple/color.jpg"
},
{
"name": "zbuffer",
"cubemap": "false",
"size": {
"x": "-1",
"y": "-1"
},
"pixel_element_size": { "value": "BYTE" },
"pixel_structure": { "value": "RGB" }
}
],
"materials": [
{
"name": "ImageBasedLightingMaterial",
"program_name": "ImageBasedLightingProgram",
"texture_names": [ "apple_texture", "skybox" ],
"inner_names": [ "Color", "IrradianceMap" ]
},
{
"name": "CubeMapMaterial",
"program_name": "CubeMapProgram",
"texture_names": [ "skybox" ],
"inner_names": [ "Skybox" ]
}
],
"programs": [
{
"name": "CubeMapProgram",
"input_texture_names": [ "skybox" ],
"output_texture_names": [ "albedo" ],
"input_scene_type": { "value": "CUBE" },
"shader": "cubemap",
"parameters": [
{
"name": "projection",
"uniform_enum": "PROJECTION_MAT4"
},
{
"name": "view",
"uniform_enum": "VIEW_MAT4"
},
{
"name": "model",
"uniform_enum": "MODEL_MAT4"
}
]
},
{
"name": "ImageBasedLightingProgram",
"input_texture_names": [ "apple_texture", "skybox" ],
"output_texture_names": [ "albedo" ],
"input_scene_type": { "value": "SCENE" },
"input_scene_root_name": "root",
"shader": "image_based_lighting",
"parameters": [
{
"name": "projection",
"uniform_enum": "PROJECTION_MAT4"
},
{
"name": "view",
"uniform_enum": "VIEW_MAT4"
},
{
"name": "model",
"uniform_enum": "MODEL_MAT4"
}
]
}
],
"scene_tree": {
"default_camera_name": "camera",
"default_root_name": "root",
"scene_matrices": [
{
"name": "root",
"matrix": {
"m11": 1.0,
"m22": 1.0,
"m33": 1.0,
"m44": 1.0
}
},
{
"name": "mesh_holder",
"parent": "root",
"quaternion": {
"x": "0.0",
"y": "0.1979232",
"z": "0.1484424",
"w": "0.9689124"
}
},
{
"name": "skybox_holder",
"parent": "root",
"quaternion": {
"x": "0",
"y": "0.0499792",
"z": "0.0",
"w": "0.9987503"
}
}
],
"scene_static_meshes": [
{
"name": "InitCleanBuffer",
"clean_buffer": {
"values": [ "CLEAR_COLOR", "CLEAR_DEPTH" ]
}
},
{
"name": "CubeMapMesh",
"parent": "skybox_holder",
"material_name": "CubeMapMaterial",
"mesh_enum": "CUBE"
},
{
"name": "ClearDepthBuffer",
"clean_buffer": {
"values": [ "CLEAR_DEPTH" ]
}
},
{
"name": "AppleMesh",
"parent": "mesh_holder",
"file_name": "apple.obj",
"material_name": "ImageBasedLightingMaterial"
}
],
"scene_cameras": [
{
"name": "camera",
"parent": "camera_holder",
"fov_degrees": 65.0,
"near_clip": 0.01,
"far_clip": 1000.0,
"position": {
"x": 0,
"y": 0,
"z": -2
},
"target": {
"x": 0,
"y": 0,
"z": 1
},
"up": {
"x": 0,
"y": 1,
"z": 0
}
}
],
"scene_lights": [
{
"name": "sun",
"parent": "root",
"light_type": "DIRECTIONAL",
"position": {
"x": "-1.0",
"y": "1.0",
"z": "1.0"
},
"color": {
"x": "1.0",
"y": "1.0",
"z": "1.0"
}
}
]
}
}
121 changes: 0 additions & 121 deletions asset/json/last_monster_standing.json

This file was deleted.

12 changes: 1 addition & 11 deletions asset/json/scene_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,6 @@
"m44": "1"
}
},
{
"name": "root_skybox",
"parent": "root",
"matrix": {
"m11": "1",
"m22": "1",
"m33": "1",
"m44": "1"
}
},
{
"name": "mesh_holder",
"parent": "root",
Expand All @@ -144,7 +134,7 @@
},
{
"name": "skybox_holder",
"parent": "root_skybox",
"parent": "root",
"quaternion": {
"x": "0",
"y": "0.0499792",
Expand Down
2 changes: 2 additions & 0 deletions asset/shader/opengl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ add_custom_target(AssetShaderOpenGL
gaussian_blur.vert
high_dynamic_range.frag
high_dynamic_range.vert
image_based_lighting.frag
image_based_lighting.vert
integrate_brdf.frag
integrate_brdf.vert
irradiance_cubemap.frag
Expand Down
Loading

0 comments on commit 371e893

Please sign in to comment.