add linear_depth material

This commit is contained in:
Nick Fisher
2025-07-01 10:08:36 +08:00
parent 506d2fb562
commit 96ef070be7
8 changed files with 7288 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
for material in image unlit_fixed_size grid; do \
for material in image unlit_fixed_size grid linear_depth; do \
echo $material
${FILAMENT_PATH}/matc -a opengl -a metal -a vulkan -o materials/$material.filamat materials/$material.mat || exit 1; \
${FILAMENT_PATH}/resgen -c -p $material -x thermion_dart/native/include/material/ materials/$material.filamat || exit 1; \

View File

@@ -1,7 +1,7 @@
material {
name : LinearDepth,
shadingModel : unlit,
requires : [ position, uv0 ],
requires : [ position ],
shadingModel : unlit,
doubleSided : false,
blending: opaque,

View File

@@ -37,6 +37,7 @@ set(MATERIAL_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/include/material/unlit_fixed_size.c"
"${CMAKE_CURRENT_SOURCE_DIR}/include/material/image.c"
"${CMAKE_CURRENT_SOURCE_DIR}/include/material/grid.c"
"${CMAKE_CURRENT_SOURCE_DIR}/include/material/linear_depth.c"
)
set_source_files_properties(${MATERIAL_SOURCES} PROPERTIES LANGUAGE CXX)

View File

@@ -0,0 +1,12 @@
.global LINEAR_DEPTH_LINEAR_DEPTH_OFFSET;
.global LINEAR_DEPTH_LINEAR_DEPTH_SIZE;
.global LINEAR_DEPTH_PACKAGE
.section .rodata
LINEAR_DEPTH_PACKAGE:
.incbin "linear_depth.bin"
LINEAR_DEPTH_LINEAR_DEPTH_OFFSET:
.int 0
LINEAR_DEPTH_LINEAR_DEPTH_SIZE:
.int 144758

View File

@@ -0,0 +1,12 @@
.global _LINEAR_DEPTH_LINEAR_DEPTH_OFFSET;
.global _LINEAR_DEPTH_LINEAR_DEPTH_SIZE;
.global _LINEAR_DEPTH_PACKAGE
.section __TEXT,__const
_LINEAR_DEPTH_PACKAGE:
.incbin "linear_depth.bin"
_LINEAR_DEPTH_LINEAR_DEPTH_OFFSET:
.int 0
_LINEAR_DEPTH_LINEAR_DEPTH_SIZE:
.int 144758

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
#ifndef LINEAR_DEPTH_H_
#define LINEAR_DEPTH_H_
#include <stdint.h>
extern "C" {
extern const uint8_t LINEAR_DEPTH_PACKAGE[];
extern int LINEAR_DEPTH_LINEAR_DEPTH_OFFSET;
extern int LINEAR_DEPTH_LINEAR_DEPTH_SIZE;
}
#define LINEAR_DEPTH_LINEAR_DEPTH_DATA (LINEAR_DEPTH_PACKAGE + LINEAR_DEPTH_LINEAR_DEPTH_OFFSET)
#endif