DEKI/ENGINE 문서
매뉴얼 API 참조
deki-3d 0.40.1
Deki 패키지 레퍼런스
deki-3d

렌더 패스로 동작하는 소프트웨어 래스터화 3D: 메시, 원근 카메라, .obj와 glTF 임포트를 제공하며 2D와 하나의 프레임 버퍼를 공유합니다.

저장소: github.com/dekiengine/deki-3d · 최신 릴리스: 0.40.0 · 엔진 0.40.0 이상 필요 · 의존: deki-rendering

DekiEditor --packages-add deki-3d <project> 또는 패키지 관리자로 설치합니다. 엔진 자체의 컴포넌트와 C++ API는 Deki 문서에 있습니다.

에디터에는 3D(으)로 표시됩니다.

컴포넌트

컴포넌트 카테고리 설명
Mesh3DSettings 3D 3D 패스가 그리는 방식: 렌더러, 타일, 텍스처와 버텍스 스위치, 스레드.
MeshComponent 3D 3D 메시를 그립니다. 오브젝트의 트랜스폼이 위치를 정하며, 메시를 보려면 씬 카메라가 원근이어야 합니다.

기능 플래그

빌드에서 뺄 수 있는 부분입니다. define이 있는 기능은 그 define으로 켜고 끄며, 나머지는 컴포넌트와 함께 제거됩니다.

기능 define 기본값
Software rasteriser DEKI_FEATURE_3D_SOFTWARE 켜짐

컴포넌트 레퍼런스

Mesh3DSettings

3D 패스가 그리는 방식: 렌더러, 타일, 텍스처와 버텍스 스위치, 스레드.

인스펙터 이름: Mesh3D 설정 · 카테고리: 3D · 유형: Deki3D::Mesh3DSettings

속성 유형 기본값 제약 설명
renderer enum "Auto" Auto, Software, GPU 메시를 그리는 것입니다. 자동은 플랫폼에 OpenGL이 있으면 GPU를, 그 밖에는 소프트웨어 래스터라이저를 씁니다. 소프트웨어는 GPU가 없는 보드가 보여 주는 그림과 똑같으므로, 에디터에서 그것을 미리 볼 때 고르세요. GPU가 있는 곳에서는 GPU가 훨씬 빠릅니다.
composeOnGpu bool true GPU 전용: 디스플레이가 GPU로 표시할 때 프레임을 GPU에서 구성하고, 메시를 다시 읽어 오지 않고 2D 레이어 사이에 바로 그립니다. 휴대용 기기에서 훨씬 빠릅니다. 프레임 뒤쪽에서 프레임 버퍼의 전체 화면을 다시 읽는 것(전체 화면 효과 패스)이 있으면 끄세요. 켜면 그 버퍼에는 메시 뒤에 그린 2D만 들어 있습니다.
tiles enum "Platform" Platform, Fixed 소프트웨어 전용: 타일 크기를 어디서 가져올지입니다. 플랫폼은 각 플랫폼 자체의 값(DEKI_3D_TILE_SIZE 정의, 없으면 32)을 씁니다. 깊이 버퍼가 내부 RAM에 들어가야 하는 마이크로컨트롤러에서는 32, Miyoo Mini에서는 64, 에디터에서는 128입니다. 고정은 어디서나 타일 크기를 씁니다. 어떤 크기에서도 그림은 같고 속도만 달라집니다.
tileSize int32 32 8~512; tiles이(가) 허용할 때 표시 타일 한 변의 픽셀 수이며 모든 플랫폼에 적용됩니다. 소프트웨어 전용. 깊이 버퍼는 타일 하나이므로 32는 2 KB로 마이크로컨트롤러에 맞고, 데스크톱은 128 이상도 괜찮습니다.
perspectiveCorrect bool true 텍스처 원근을 보정합니다. 끄면 PlayStation 시대 하드웨어처럼 텍스처가 일그러지고, 채우기 비용이 약 10분의 1 줄어듭니다.
vertexSnap bool false 투영된 버텍스를 정수 픽셀로 반올림하여, 고정 소수점 시대 하드웨어의 떨림을 냅니다.
fillThreads int32 1 1~16 소프트웨어 전용: 기기나 데스크톱 빌드에서 그리는 스레드 수입니다. 화면의 타일을 채우고, 삼각형이 수백 개 이상인 메시의 각 부분 지오메트리를 나눠 맡습니다. 1이면 스레드를 전혀 시작하지 않고, 2는 듀얼 코어 보드에 맞으며, 코어 수를 넘으면 더 도움이 되지 않습니다. 에디터는 패키지를 언로드 가능한 DLL로 불러오므로 항상 스레드 하나로 미리 보여 줍니다. 어느 쪽이든 그림은 같습니다.

MeshComponent

3D 메시를 그립니다. 오브젝트의 트랜스폼이 위치를 정하며, 메시를 보려면 씬 카메라가 원근이어야 합니다.

인스펙터 이름: 메시 컴포넌트 · 카테고리: 3D · 유형: Deki3D::MeshComponent

속성 유형 기본값 제약 설명
mesh AssetRef (Mesh) "" 컴파일된 메시 에셋입니다. 임포트한 모델을 여기에 할당합니다. 비워 두면 대신 아래의 프리미티브를 그립니다.
primitive enum "Cube" Cube, Quad, Pyramid 메시 에셋이 할당되지 않았을 때 그릴 내장 도형입니다.
tintColor Color "#FFFFFFFF" 메시 자체의 색상에 곱해집니다. 흰색이면 그대로 표시됩니다.
shading enum "VertexLit" Unlit, VertexLit, Flat Unlit is flat colour. Vertex lit shades each triangle by the scene's lights, from the normals of its corners. Flat shades each triangle from its own face, which is the faceted look. A scene without a Light draws every mesh unlit.
doubleSided bool false 메시의 바깥쪽뿐 아니라 안쪽도 그립니다. 채우기 비용이 약 두 배가 됩니다.
castShadows bool true 그림자를 드리우는 라이트(Light의 그림자 드리우기)로부터 그림자를 드리웁니다. 디스플레이가 OpenGL로 그릴 때만입니다.
shader AssetRef (Shader) "" 이 메시를 GPU에서 그리는 HLSL .shader입니다. Shade()는 위의 셰이딩 모델이 그렸을 결과를 받아 색상을 돌려주고, Displace()는 버텍스를 움직입니다. GPU가 없는 보드용 빌드는 포함하는 씬이 이것을 쓰는 동안 중단됩니다.
shaderParams Vector3 [0.0, 0.0, 0.0] 셰이더가 uParams로 읽는 숫자 세 개입니다. 속도, 세기 등 셰이더가 원한다고 밝힌 것을 넣습니다.
shaderColor Color "#FFFFFFFF" 셰이더가 uColor로 읽는 색상입니다.

RendererComponent에서 sortingOrder, ignoreClip, pixelSnap, alphaMode을(를) 상속합니다.

변경 내역

변경 내역은 영어로 되어 있습니다.

0.40.0

Added

  • glTF models. .gltf and .glb files compile like .obj files, with their node transforms, base colours and base colour textures. Animation and skinning are not imported yet.

Changed

  • minEngine 0.40.0: built against engine 0.40.0. A build of this package from before does not load and is rebuilt.
  • A lit triangle wholly in front of the eye lights only its first corner, the one its light is taken from; all three were lit. Geometry of a scene of small lit cubes is about 9% cheaper on a desktop.
  • A background fills 4-byte pixels a row at a time, as it did 2-byte ones: the fill of a 320x240 ARGB8888 frame went from 560 to 300 microseconds on a desktop.
  • A tile with no triangle draws its background without resetting a depth buffer it never reads.
  • The pixels are the same: RasterCost draws the scene in RGB565 and ARGB8888 and prints its times and a hash of the frame.

Fixed

  • Texture coordinates far round a texture (32 turns of a 1024-texel texture, 2048 of a 16-texel one) overflowed the fixed point a span steps them in, and each processor drew its own smear. They are brought back by whole turns first; nearer coordinates draw exactly as before.
  • The table of reciprocals a span reads is made before the fill threads start. It was made by the first thread to need it, which another could read half made.
  • Vertex Lit is described as what it does: a triangle is shaded by the scene's lights from the normals of its corners, where the tooltip and a comment said each vertex was shaded.

0.30.3

Changed

  • Mesh3DRenderer::Gpu is Mesh3DRenderer::GPU, so the Renderer list shows "GPU" in English as in the other languages. Scenes keep the value, which is stored as a number; code naming Mesh3DRenderer::Gpu changes to GPU.
  • The README says where it has run: the desktop, a T-Deck and a Miyoo Mini.

이전 릴리스: CHANGELOG.md


패키지의 리플렉션 데이터에서 생성했습니다(엔진 0.40.1). 속성 이름은 씬 파일에서 쓰는 키입니다. 이름을 바꿔도 별칭이 유지됩니다(호환성).