Skip to content

Commit

Permalink
Merge pull request #92 from Cchen-77/main
Browse files Browse the repository at this point in the history
feature: one-sample-mis for micrograin material & gaussian process implicit surface rendering support
  • Loading branch information
mchenwang authored Oct 8, 2024
2 parents 74a36b4 + d466828 commit 6b10ad0
Show file tree
Hide file tree
Showing 44 changed files with 1,953 additions and 105 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ target
NJUCG.mdj
cmake-build*
.idea
./doxygen-doc
./doxygen-doc
scenes/**/*.hdr
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
[submodule "tools/ScenePreviewer"]
path = tools/ScenePreviewer
url = https://github.com/r1ckhu/Moer_ScenePreviewer.git
[submodule "ext/autodiff"]
path = ext/autodiff
url = https://github.com/autodiff/autodiff.git
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (MSVC)
add_compile_options("/MP")
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("/bigobj")
# set unicode as character set
# add_definitions(-DUNICODE -D_UNICODE)
endif (MSVC)
Expand All @@ -18,6 +19,7 @@ endif (FM_SPEED_DEFAULT)

option(EMBREE_USE_TBB "Enable TBB in embree." OFF)
option(USE_SAMPLED_SPECTRUM "" OFF)
option(ENABLE_GPISMEDIUM "enable gpis medium feature" ON)

set(MESH_LOADER "Tinyobjloader" CACHE STRING "Select mesh loader")
set_property(CACHE MESH_LOADER PROPERTY STRINGS Assimp Tinyobjloader)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Moer is developed by NJUMeta (www.njumeta.com) from Nanjing University.
![hair](https://yjpp.oss-cn-hangzhou.aliyuncs.com/uPic/C6966B38E3AD16F8AC9CC9D86C73921E.jpg)
![teapot](https://yjpp.oss-cn-hangzhou.aliyuncs.com/uPic/tea-pot.png)
![disney](https://yjpp.oss-cn-hangzhou.aliyuncs.com/uPic/disneybsdf.png)
![micrograin-teapot](https://github.com/Cchen-77/images/blob/main/micrograin.jpg)
![gpis](https://github.com/Cchen-77/images/blob/main/gpis.jpg)
## Checklist

### Accelerator
Expand Down Expand Up @@ -63,6 +65,7 @@ Moer is developed by NJUMeta (www.njumeta.com) from Nanjing University.
### Media
- [X] homogeneous
- [X] hetergeneous
- [X] gaussian process implicit surface
- [ ] others

### BxDF
Expand All @@ -73,6 +76,7 @@ Moer is developed by NJUMeta (www.njumeta.com) from Nanjing University.
- [X] disney
- [X] plastic
- [X] hair
- [X] micrograin for porous layer
- [ ] others

### Shape
Expand Down
12 changes: 12 additions & 0 deletions ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,16 @@ if (NOT TARGET stb)
target_link_libraries(${TARGET_NAME} PUBLIC stb)
target_include_directories(stb PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/stb)
set_ide_folder(stb ${3DPARTY_FOLDER})
endif()

if(NOT TARGET autodiff)
message(STATUS "============start config autodiff============")
set(AUTODIFF_BUILD_TESTS OFF)
set(AUTODIFF_BUILD_PYTHON OFF)
set(AUTODIFF_BUILD_EXAMPLES OFF)
set(AUTODIFF_BUILD_DOCS OFF)
add_subdirectory(autodiff)
target_link_libraries(${TARGET_NAME} PUBLIC autodiff)
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/autodiff)
set_ide_folder(autodiff ${3DPARTY_FOLDER})
endif()
1 change: 1 addition & 0 deletions ext/autodiff
Submodule autodiff added at cb2d6e
142 changes: 142 additions & 0 deletions scenes/gpis-1/scene.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"renderer" : {
"spp" : 1,
"output_file" : "gpis"
},

"mediums" : [
{
"name" : "gpis",
"type" : "gpis",
"num_sample_points": 8,
"marching_step_size": 10000,
"gaussian_process":{
"type":"std",
"mean":{
"type":"procedural",
"func":"knob",
"transform":{
"position":[0,0,0],
"scale":[1,1,1],
"rotation":[0,30,0]
}
},
"covariance":{
"type":"squared_exponential",
"lengthScale":0.1,
"sigma":0.01
}
},
"phase":{
"type":"lambert",
"albedo":[0.9, 0.3, 0.35]
}
}
],

"materials" : [
{
"name" : "leftWall",
"type" : "lambert",
"albedo" : [0.63, 0.0065, 0.05]
},
{
"name" : "rightWall",
"type" : "lambert",
"albedo" : [0.14, 0.45, 0.091]
},
{
"name" : "floor",
"type" : "lambert",
"albedo" : [0.725, 0.71, 0.68]
},
{
"name" : "ceiling",
"type" : "lambert",
"albedo" : [0.725, 0.71, 0.68]
},
{
"name" : "backWall",
"type" : "lambert",
"albedo" : [0.725, 0.71, 0.68]
},
{
"name" : "light",
"type" : "lambert",
"albedo" : [0, 0, 0]
},
{
"name" : "interface",
"type" : "null",
"in_medium" : "gpis"
}
],

"entities" : [
{
"type" : "quad",
"base" : [0, 0, 0],
"edge0" : [2, 0, 0],
"edge1" : [0, 0, 2],
"material" : "floor"
},
{
"type" : "quad",
"base" : [0, 2, 0],
"edge0" : [0, 0, -2],
"edge1" : [-2, 0, 0],
"material" : "ceiling"
},
{
"type" : "quad",
"base" : [0, 1, -1],
"edge0" : [-2, 0, 0],
"edge1" : [0, 2, 0],
"material" : "backWall"
},
{
"type" : "quad",
"base" : [-1, 1, 0],
"edge0" : [0, 0, 2],
"edge1" : [0, 2, 0],
"material" : "leftWall"
},
{
"type" : "quad",
"base" : [1, 1, 0],
"edge0" : [0, 0, -2],
"edge1" : [0, 2, 0],
"material" : "rightWall"
},
{
"type" : "quad",
"transform": {
"position": [-0.005, 1.98, -0.03],
"scale": [0.47, 0.1786, 0.38],
"rotation": [0, 180, 180]
},
"emission" : [30, 28, 20],
"material" : "light"
},
{
"type" : "cube",
"material" : "interface",
"transform" : {
"scale" : [3, 3, 3],
"position" : [0, 1, 0]
}
}
],

"camera" : {
"resolution" : [512, 512],
"type" : "pinhole",
"fov" : 19.5,

"transform" : {
"position" : [0, 1, 7],
"up" : [0, 1, 0],
"look_at" : [0, 1, 0]
}
}
}
163 changes: 163 additions & 0 deletions scenes/gpis-2/scene.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"renderer" : {
"spp" : 32,
"output_file" : "gpis"
},

"mediums" : [
{
"name" : "gpis-hard",
"type" : "gpis",
"marching_num_sample_points":64,
"marching_step_size": 10000,
"gaussian_process":{
"type":"std",
"mean":{
"type":"procedural",
"func":"knob",
"transform":{
"position":[-0.8,0.37,0],
"scale":[0.5,0.5,0.5],
"rotation":[0,0,0]
}
},
"covariance":{
"type":"squared_exponential",
"lengthScale":0.1,
"sigma":0.01
},
"global_condition":{
"enable":false,
"points":[
[0,0,0],
[1,1,1]
],
"derivative_types":[
"none",
"first"
],
"derivative_dirs":[
[0,0,0],
[1,0,0]
],
"values":[
0,
1
]
}
},
"phase":{
"type":"lambert",
"albedo":[0.9, 0.3, 0.35]
}
},
{
"name" : "gpis-soft",
"type" : "gpis",
"marching_num_sample_points":32,
"marching_step_size": 10000,
"gaussian_process":{
"type":"std",
"mean":{
"type":"procedural",
"func":"knob",
"transform":{
"position":[0.8,0.37,0],
"scale":[0.5,0.5,0.5],
"rotation":[0,0,0]
}
},
"covariance":{
"type":"squared_exponential",
"lengthScale":0.1,
"sigma":0.05
}
},
"phase":{
"type":"lambert",
"albedo":[0.9, 0.3, 0.35]
}
},
{
"name" : "homogeneous",
"type" : "homogeneous",
"sigmaT" : [20, 20, 20],
"albedo" : [0.8, 0.8, 0.8]
}
],

"materials" : [
{
"name": "floor",
"albedo": {
"type": "checker",
"on_color": [
0.725,
0.71,
0.68
],
"off_color": [
0.325,
0.31,
0.25
],
"res_u": 20,
"res_v": 20
},
"type": "lambert"
},
{
"name" : "interface-hard",
"type" : "null",
"in_medium":"gpis-hard"
},
{
"name" : "interface-soft",
"type" : "null",
"in_medium":"gpis-soft"
}
],

"entities" : [
{
"type" : "quad",
"base" : [0, 0, 0],
"edge0" : [6, 0, 0],
"edge1" : [0, 0, 6],

"material" : "floor"
},
{
"type" : "infinite_sphere",
"emission" : "textures/envmap.hdr"
},
{
"type" : "cube",
"material" : "interface-hard",
"transform" : {
"scale" : [2, 2, 2],
"position" : [-0.8, 1.05, 0]
}
},
{
"type" : "cube",
"material" : "interface-soft",
"transform" : {
"scale" : [2, 2, 2],
"position" : [0.8, 1.05, 0]
}
}
],

"camera" : {
"resolution" : [1024, 1024],
"type" : "pinhole",
"fov" : 19.5,

"transform" : {
"position" : [0, 4, 7],
"up" : [0, 1, 0],
"look_at" : [0, 0, 0]
}
}
}
Binary file added scenes/gpis-2/textures/envmap.hdr
Binary file not shown.
Binary file added scenes/heterogeneous2/models/smoke.nvdb
Binary file not shown.
Loading

0 comments on commit 6b10ad0

Please sign in to comment.