핵심 렌더링 파이프라인: 카메라, 렌더 시스템, 표준 2D 렌더러, QuadBlit, 렌더 패스, 정렬.
저장소: github.com/dekiengine/deki-rendering · 최신 릴리스: 0.40.0 · 엔진 0.40.0 이상 필요
DekiEditor --packages-add deki-rendering <project> 또는 패키지 관리자로 설치합니다. 엔진 자체의 컴포넌트와 C++ API는 Deki 문서에 있습니다.
에디터에는 Rendering(으)로 표시됩니다.
컴포넌트
| 컴포넌트 | 카테고리 | 설명 |
| CameraComponent | 코어 | 뷰입니다. 위치, 보여 줄 월드의 범위, 클리어 색상을 정합니다. |
| Light | 렌더링 | 라이트입니다. 주변광, 태양, 한 점 주위, 또는 원뿔 모양으로 비춥니다. 메시와 2D 세계를 비춥니다. |
| ScreenEffect | 렌더링 | 완성된 프레임에 적용하는 전체 화면 셰이더입니다. 디스플레이가 OpenGL로 표시할 때만입니다. |
기능 플래그
빌드에서 뺄 수 있는 부분입니다. define이 있는 기능은 그 define으로 켜고 끄며, 나머지는 컴포넌트와 함께 제거됩니다.
| 기능 | define | 기본값 |
| Lights | DEKI_FEATURE_LIGHTS | 켜짐 |
컴포넌트 레퍼런스
CameraComponent
뷰입니다. 위치, 보여 줄 월드의 범위, 클리어 색상을 정합니다.
인스펙터 이름: 카메라 컴포넌트 · 카테고리: 코어 · 유형: DekiRendering::CameraComponent
| 속성 | 유형 | 기본값 | 제약 | 설명 |
| clearColor | Color | "#314D79FF" | | 무언가를 그리기 전에 화면을 채우는 색상입니다. 아무것도 덮지 않은 곳에 이 색상이 보입니다. |
| projection | enum | "Orthographic" | Orthographic, Perspective | 직교는 월드의 고정된 높이를 평평하게 보여 줍니다. 원근은 시야각으로 깊이를 보여 주며 3D 메시용입니다. 스프라이트는 여전히 평평하게 그려집니다. |
| orthoHeight | float | 15 | 0.01~100000; 단위 m; projection이(가) 허용할 때 표시 | 카메라가 위에서 아래까지 보여 주는 월드의 양입니다. 모든 화면은 이 값을 높이에 꽉 차게 스케일합니다(옆의 x가 배율입니다). |
| pixelPerfect | bool | false | projection이(가) 허용할 때 표시 | 픽셀 아트용입니다. 정수 배율로만 스케일하므로 아트의 모든 픽셀이 화면에서 같은 크기가 되고, 카메라와 그려지는 모든 것을 픽셀에 맞춥니다. 배율은 내림하므로 카메라는 직교 높이보다 조금 더 넓게 보여 주며, 1x에 못 미치는 작은 화면에서는 잘립니다. |
| pixelGrid | enum | "Screen" | Screen, Art; projection이(가) 허용할 때 표시 | 픽셀 퍼펙트가 카메라와 그려지는 모든 것을 맞추는 기준입니다. 화면: 화면 픽셀에 맞추므로 아트를 크게 보여 주는 화면에서도 움직임이 부드럽습니다. 아트: 아트 자체의 픽셀에 맞추므로 픽셀 사이에 아무것도 놓이지 않고, 큰 화면에서는 그 크기만큼씩 움직입니다. |
| fieldOfView | float | 60 | 10~150; projection이(가) 허용할 때 표시 | 세로 시야각(도)입니다. 화면이 넓을수록 양옆이 더 많이 보입니다. 60이 일반적인 기본값이며, 크게 할수록 넓어 보이고 가장자리가 더 왜곡됩니다. |
| nearPlane | float | 0.1 | projection이(가) 허용할 때 표시 | 이보다 가까운 것은 그려지지 않습니다. 높여도 비용이 들지 않고 깊이 정밀도가 좋아지므로 씬이 허용하는 한 크게 유지하세요. |
| farPlane | float | 100 | projection이(가) 허용할 때 표시 | 이보다 먼 것은 그려지지 않습니다. |
| clearEveryFrame | bool | true | | 매 프레임 전에 화면을 클리어합니다. 끄면 이전 프레임이 아래에 남습니다. 전체 화면 배경이 모든 것을 덮을 때는 더 빠르고, 잔상을 원할 때도 가끔 쓸 수 있습니다. |
| litUpToSortOrder | int32 | 2147483647 | | 라이트(Light 컴포넌트)는 이 카메라가 그리는 것 중 이 정렬 순서까지를 비춥니다. 그보다 위에 그려지는 것(UI 등)은 자신의 색상을 유지합니다. 기본값은 모든 것을 비춥니다. |
Light
라이트입니다. 주변광, 태양, 한 점 주위, 또는 원뿔 모양으로 비춥니다. 메시와 2D 세계를 비춥니다.
카테고리: 렌더링 · 유형: DekiRendering::Light
| 속성 | 유형 | 기본값 | 제약 | 설명 |
| type | enum | "Point" | Ambient, Directional, Point, Spot | 주변광은 모든 것을 똑같이 비춥니다. 디렉셔널은 태양처럼 먼 한 방향에서 비춥니다. 포인트는 오브젝트 주위를 범위까지 비춥니다. 스포트는 오브젝트의 X축을 따라 원뿔을 비추며, 방향은 오브젝트의 회전을 따릅니다. |
| color | Color | "#FFFFFFFF" | | 라이트의 색상입니다. |
| intensity | float | 1 | 0~8 | 라이트의 세기입니다. 1은 가장 강한 곳에서 색상을 원래대로 비추고, 0.5는 그 절반입니다. 라이트는 더해지며 최대 색상의 두 배까지입니다. |
| range | float | 3 | 0.01~100000; 단위 m; type이(가) 허용할 때 표시 | 라이트가 닿는 거리(미터)입니다. 그곳에서 완전히 사라집니다. |
| spotAngle | float | 45 | 1~179; type이(가) 허용할 때 표시 | 원뿔의 전체 폭(도)입니다. |
| spotSoftness | float | 0.25 | 0~1(슬라이더); type이(가) 허용할 때 표시 | 원뿔이 가장자리로 갈수록 얼마나 흐려지는지입니다. 0은 선명한 가장자리, 1은 중심부터 흐려집니다. |
| yaw | float | -25 | -180~180; type이(가) 허용할 때 표시 | 라이트가 오는 방향을 수직축 둘레의 각도(도)로 나타냅니다. 0은 카메라 뒤, 90은 오른쪽입니다. |
| pitch | float | 55 | -90~90; type이(가) 허용할 때 표시 | 라이트의 높이(도)입니다. 90은 바로 위에서 아래로, 0은 지평선과 같은 높이입니다. |
| bands | int32 | 0 | 0~8; type이(가) 허용할 때 표시 | 2D 전용: 0은 부드럽게 흐려집니다. 2에서 8은 그 수만큼의 뚜렷한 고리로 비추며 가운데가 가장 밝습니다. 픽셀 아트용입니다. |
| castShadows | bool | false | type이(가) 허용할 때 표시 | 그 빛 안의 메시가 그림자를 드리웁니다. 디스플레이가 OpenGL로 그릴 때만이며, 한 프레임에서 그림자를 드리우는 라이트는 최대 두 개입니다. OpenGL이 없는 보드는 그림자 없이 라이트를 그리고, 빌드가 그렇다고 알려 줍니다. 포인트 라이트는 아직 그림자를 드리우지 않습니다. |
| shadowResolution | int32 | 1024 | 128~4096; type이(가) 허용할 때 표시 | 섀도 맵 한 변의 픽셀 수입니다. 클수록 선명하지만 GPU 메모리와 시간이 듭니다. |
| shadowBias | float | 0.002 | 0~0.1; type이(가) 허용할 때 표시 | 그림자를 드리우는 표면에서 그림자를 뒤로 밀어냅니다. 빛을 받는 표면에 줄무늬 그림자가 생기면 올리세요. 너무 높으면 그림자가 드리우는 물체에서 떨어져 보입니다. |
ScreenEffect
완성된 프레임에 적용하는 전체 화면 셰이더입니다. 디스플레이가 OpenGL로 표시할 때만입니다.
인스펙터 이름: 화면 효과 · 카테고리: 렌더링 · 유형: DekiGL::ScreenEffect
| 속성 | 유형 | 기본값 | 설명 |
| shader | AssetRef (Shader) | "" | float4 Effect(float2 uv)를 정의하는 HLSL .shader입니다. 창의 각 픽셀 색상을 돌려주며, uv는 프레임 전체에서 왼쪽 아래부터 오른쪽 위까지 0에서 1로 바뀝니다. Frame(uv)로 프레임을 읽습니다. |
| params | Vector3 | [0.0, 0.0, 0.0] | 셰이더가 uParams로 읽는 숫자 세 개입니다. 세기, 속도 등 셰이더가 원한다고 밝힌 것을 넣습니다. |
| color | Color | "#000000FF" | 셰이더가 uColor로 읽는 색상입니다. |
프로젝트 설정
렌더링 설정
프로젝트 설정 섹션 Rendering(RenderingProjectSettings)입니다.
카테고리: 설정 · 유형: DekiRendering::RenderingProjectSettings
| 속성 | 유형 | 기본값 | 제약 | 설명 |
| frameMode | enum | "Auto" | Auto, WholeFrames, Strips | 각 프레임을 화면에 보내는 방식입니다. Auto(기본값)는 게임이 시작될 때 장치에서 고릅니다. 프레임 버퍼가 내부 RAM에 여유 있게 들어가면 전체 프레임, 들어가지 않으면 스트립입니다(픽셀당 2바이트인 536x240 화면은 257 KB로, ESP32-S3의 내부 RAM 여유 공간보다 큽니다). 전체 프레임은 각 프레임을 버퍼 하나에 한 번 그리며, 그 버퍼가 내부 RAM에 있으면 더 빠릅니다. 스트립은 내부 RAM의 작은 버퍼에 몇 행씩 그리고, 다음 스트립을 그리는 동안 각 스트립을 보냅니다. PSRAM에 전체 프레임을 그리는 것보다 훨씬 빠릅니다. 둘 다 같은 픽셀을 만들고 모든 기능을 유지합니다. 어느 쪽을 쓰는지와 그 이유는 부팅 로그와 DEKI:STATS에 표시됩니다. 에디터는 항상 전체 프레임을 그립니다. |
| bandRows | int32 | 40 | 2~256 | 프레임을 스트립으로 그릴 때 각 스트립의 행 수입니다. 대부분의 화면에는 40이 맞습니다. 스트립이 높을수록 한 프레임에 장면을 도는 횟수가 줄지만 내부 RAM을 더 씁니다: 스트립 하나와 전송용 복사본 두 개, 각각 화면 너비 × 이 행 수 × 픽셀당 2바이트입니다. |
| redrawChanges | bool | false | | 바뀐 부분만 다시 그립니다. 각 프레임에서 모든 오브젝트가 그리는 것을 지난 프레임과 비교해, 다른 부분만 그려서 디스플레이로 보냅니다. 아무것도 움직이지 않은 프레임은 거의 시간이 들지 않습니다. 화면 대부분이 바뀌는 프레임(스크롤하는 카메라, 화면 전체 애니메이션)은 평소처럼 전체를 그립니다. 어디에 그리는지 알려 줄 수 없는 렌더 패스나 클리어하지 않는 카메라가 있으면 매 프레임 전체를 그립니다. |
변경 내역
변경 내역은 영어로 되어 있습니다.
0.40.0
Added
- Pixel Grid on the camera: what Pixel Perfect snaps to. Screen, the default, keeps the camera and everything drawn on whole screen pixels. On a screen that shows the art larger the camera then moves a screen pixel at a time: a 2:1 isometric walk at 2x moves the map 2 pixels across and 1 down every frame, where it moved 2 down every other frame. Art is the grid Pixel Perfect had: the art's own pixels, so nothing sits between two of them. At 1x the two are the same. FrameCamera::snapStep is 1 for Screen.
- Blits onto ARGB8888 at a whole-number scale take a fast path. Every fast path was for RGB565 screens, so on an ARGB8888 one every sprite and tile, even at 1:1, was sampled pixel by pixel by the generic pipeline. A plain blit (no tint, key, dither or flips) at 1x, 2x, 3x and so on now reads each source pixel once and fills the block it covers (QuadBlit::WholeScaleRows_ARGB8888), with the pipeline's pixels. Nothing to set. On the Anbernic RG40XX H (640x480, a pixel-art farm drawn at 2x) blits went from 12.3 to 6.4 ns a pixel and the game from 35-47 to 60 frames a second.
- A renderer can draw many pieces. RendererComponent::GetPieceCount, GetPiecePlace, GetPieceExtents, RenderPieceContent, GetPieceVersion and GetPieceDrawKey: each piece is placed and sorted on its own, as a child object would be, and read from the one component. A renderer with no pieces (the default) draws as before. deki-2d's SpriteBatchComponent uses it.
- Sprites are drawn from runs. A sprite drawn 1:1 and unturned onto RGB565 keeps its box of non-transparent pixels as runs: for each row, how many pixels to pass over, how many to copy and how many to blend, with only those pixels kept (QuadBlit::PackRuns, BlitRuns, PackedPixels). Drawn from the picture, every pixel of an animation frame was read, three bytes each, to find the ones to draw; where pictures are in external memory that reading was most of what a character cost. A sprite mirrored across or down has runs of its own, and a tint or a fade is applied as the runs are drawn, so it can change every frame. Nothing to set: the runs are made the first time a sprite of up to 128x128 pixels is drawn, on targets that have external memory, in 64 KB blocks of it taken as they fill: up to eight, and never the last half megabyte the target has free. A character's frame takes about 1.2 KB. A sprite scaled, turned or dithered, or one there is no room for, is drawn as before, and another scene starts with the store empty. The pixels are the same, checked against the plain blit over random pictures, mirrors, tints, positions and clips, and on a board frame by frame. On a LilyGO T-Deck the "Your
first game" farm with 16 villagers walking went from 18.6 to 16.7 ms a frame, the display's 60 fps, as with none; it holds 16.9 ms with each villager on a sheet of its own (256 frames, about 300 KB of runs), and 17 ms with half of them mirrored, a quarter tinted and a quarter faded.- The profiler breaks a frame down by object. While it is on, each renderer, and each render pass on each object, has a row (RenderProfiler::TakeObjects): its path and type, its share of finding what changed, of making and of drawing its pixels, how many times it was drawn, and why its area was drawn again (new, changed, still on screen while the world scrolled, drawn over a pin). Off, nothing is counted. The Render Profiler window (Tools > Rendering) shows the rows for the Play view, or for a board on a serial port. Render passes name themselves for it (RenderPass::Name, "Render pass" unless they say otherwise).
- Redraw Changes moves the last frame when the camera scrolls. A camera that moved by whole pixels, and sits on whole pixels, used to redraw the whole frame; now the frame's pixels are moved and only the edge it uncovers and what changed besides are drawn. Frames match ones drawn whole. A scene with 2D lights, a frame drawn in strips, a camera between pixels, and a render pass that reports its own changes but not RenderPass::FollowsScroll still redraw whole frames. DekiRenderer::ScrolledBy and RenderContext::scrollable, scrollX and scrollY carry it; a custom renderer needs no change. New virtuals on DekiRenderer and RenderPass: packages built against the old headers must be rebuilt.
- What stays on screen keeps its pixels while the camera scrolls. A renderer drawn the same at the same place on screen, such as a HUD panel under the camera, keeps the pixels of its opaque middle as the frame moves (DekiRenderer::ScrollPins); only its see-through edge and the band it leaves are drawn again. Anything drawn over it that moved redraws it.
- A drawing's area is only what it can write. A sprite, shape or other renderer drawn 1:1 and unturned counts only the box of its non-transparent pixels as changed: an animation frame's empty margin is not redrawn. QuadBlit::VisibleBounds and QuadBlit::OpaqueInterior work them out; they are kept, by pixels and revision, in a small table in external memory. Pixels with no Source::revision are not trimmed.
- Changed parts close together are drawn as one. Each part redrawn walks the scene and sets up every render pass again, so parts are merged while a merge adds fewer pixels than that costs (DirtyRegion::MergeCheaperThan, DekiRenderSystem::SetPartCostPixels, 4096 by default).
- DeferredClear::colour and QuadBlit::PendingClearColour: the colour of a clear still pending, whatever it covers, for a render pass about to write every pixel the clear covers in a frame or a redrawn part of one, which then drops the clear (DeferredClear::pixel stays for whole frames only). DekiRenderSystem and the lit clear of 2D lights give it.
- QuadBlit::SwapClipState sets the clip stack, the target limit and the clip switch aside, for a pass drawing into a buffer of its own in the middle of a frame.
- Finding what changed reuses what it measured. A renderer can give a draw key (RendererComponent::GetDrawKey): a value from its own fields that changes whenever its content could. While the key, the object's scale and its turn stay the same, what was measured of its content (its size, pixels, area and the signature they make) is reused, and only where it is drawn is worked out again; a renderer with no key is measured in full each frame as before. Kept in a table in external memory. A new virtual on RendererComponent: packages built against the old headers must be rebuilt. On a LilyGO T-Deck, finding the changes of the "Your first game" farm went from 7.6 to 6.2 ms a frame.
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 frame redrawn in parts costs less with many sprites moving. On a LilyGO T-Deck, the "Your first game" farm with the camera following the farmer and villagers walking about went from 18.1 to 16.6 ms a frame with 4 villagers, 20.6 to 16.7 ms with 8 (both now the display's 60 fps) and 26.3 to 18.6 ms with 16. The pixels are the same: checked on the board, each frame drawn in parts against the same frame drawn whole. What changed:
- A sprite drawn 1:1 and unturned blits only its box of non-transparent pixels, as only that box already counted as its area. An animation frame's empty margin is no longer read.
- What is known of a source's pixels (its visible box, its opaque interior) is kept in a few places for each source, not one: sources that shared a place pushed each other out every frame, and each time the pixels were walked again.
- Each part passes over the objects outside it from a short list of their areas, made as the frame's plan is built, without reading the plan.
- A renderer's content is kept beside what is reused of it from frame to frame, not copied into the plan for every object every frame.
- DirtyRegion keeps the sum of its areas as rectangles are added, and merging looks again only at the pairs a merge changed. The pairs merged are the same (new tests compare them with comparing every pair again).
- A scrolled frame's rows find the pins they cross only where a pin starts or ends.
- DirtyRegion::Add joins a rectangle to one already there when their bounding box is no larger than the two together: a sprite that moved a pixel is one rectangle, not two. Above the merge threshold the set is merged down to a quarter under it, not to it, so the next rectangles are added without merging again.
- Parts are drawn as one when closer than 2048 pixels of extra area (kPartCostPixels, was 4096): a part costs less than it did.
- Changed parts are rounded out to 4 pixels, not 8 (kRedrawAlign): fewer pixels are drawn again around a small sprite. A display rounds what it is sent for itself.
- The frame's plan and its lists are in external memory (ExternalAllocator) where the target has it. They came from the C library, which on a board put them, or the sizes they grew through, in internal RAM.- Redrawn parts cost less. Taking what stays on screen out of what changed allocates nothing (1.85 to 0.2 ms a frame on the T-Deck farm), and a part passes over an object outside it that has nothing else to draw before setting anything up for it.
- Finding what changed no longer allocates every frame. DirtyRegion::Align folded its rectangles back through a new list each time and threw the old one away, so the region grew its list again from nothing: five allocations a frame on a T-Deck. It keeps both lists now.
Breaking
- Positive rotation now draws counter-clockwise. QuadBlit applied the angle in screen space, where Y runs down, so a sprite turned clockwise while its children, lights, 3D and physics turned counter-clockwise. A rotated sprite now turns the same way as the rest of the engine, and a child stays fixed to a rotated parent. A scene or script that set a rotation by eye needs the sign of that rotation flipped.
- A turned sprite no longer moves by a pixel. QuadBlit read each pixel of a rotated draw at its corner instead of its centre, so a sprite turned by a half turn or a quarter turn landed one pixel right of, or below, where it stands unturned. It now covers the same pixels, as Tiled and other editors draw it. Rotated sprites placed by eye may sit a pixel off.
- A scaled sprite reads the source pixel under each drawn pixel's middle. QuadBlit::BlitScaled read the one under its left or top edge. A sprite drawn at a whole multiple of its size looks the same; one shrunk, or grown by a fraction, shows some different edge pixels: a 6-pixel strip drawn 2 wide now shows its second and fifth pixels, not its first and fourth. Exactly between two pixels it takes the first, so halving still takes every other pixel from the first. This matches turned sprites and Tiled. The cost is the same.
Fixed
- The profiler's kinds of component kept no name for draws whose content was reused, so a board's DEKI:PROFILE listed them as "?": AddBlit takes the name too.
0.30.0
Declares the capabilities it uses
- package.json has "capabilityDefines": ["opengl"] and "filtersTexturesWith": ["opengl"]: its GPU code tests DEKI_CAPABILITY_OPENGL, and its GL sprite sink draws textures filtered. The editor reads them instead of knowing opengl itself; needs the editor from this release.
Changed
- minEngine 0.30.0: built against engine 0.30.0. A build of this package from before does not load and is rebuilt.
- Lights are a feature (lights, DEKI_FEATURE_LIGHTS, the Light component): a device build whose scenes and code have no Light leaves it out. Light.cpp is not compiled, nothing is lit, and the light loops stay in flash: such a game spends no internal RAM on lights (a T-Deck build had 1.4 KB of their code there, and 4.2 KB of tables, below). Code that uses Light includes Light.h inside #ifdef DEKI_FEATURE_LIGHTS; RenderingFeatures.h turns it on in a build that does not configure features.
- The 2D light's colour tables (about 2 KB for each thread that lights) are allocated by the first frame lit, not held static: a game without lights keeps that internal RAM (4.2 KB on a T-Deck, where a second core lights too). With no memory for them the frame is drawn unlit, and the log says so once.
- The frame's clear waits for its first write, wherever that is: the renderer leaves it with QuadBlit (SetPendingClear), a blit into the buffer runs it first, and so must a render pass that writes into the buffer itself and says it does not (RenderPass::WritesBuffer false): it now calls QuadBlit::BeforeWriting(ctx.buffer) before it writes, as well as NoteWritten after. Such a pass that does not would have its pixels cleared over. Before, any pass with a hook had the clear made first.
- A frame holding nothing but its clear when the 2D light is due, and lit the same all over (Lighting2D::Uniform: no point or spot light in view), is cleared in the clear colour lit (DeferredClear::runLit) instead of cleared and lit after, still when the frame is first written. The same pixels. A 3D scene lit by an ambient light and the sun saves the 2D light's pass over the screen: 6.8 ms a frame on a T-Deck.
- A frame that cannot be drawn in strips (a 3D scene's) is drawn in a frame the display lends (IScanOrderedDisplay::LendFrame) when every pixel of it is drawn anew (the camera clears every frame, changes are not redrawn on their own, no screenshot is wanted), and goes to the display as it is. On a T-Deck that is the 5 ms copy of each frame gone: a 3D corridor of 2,000 triangles at 19.5 frames a second, from 17.
- A render pass about to write every pixel of the frame itself can take the pending clear as one pixel (QuadBlit::TakePendingClear, DeferredClear::pixel), lit when the light came first, and draw it where it draws nothing: deki-3d's software rasteriser does, which saves the clear's own pass over the screen.
- The shader loader is registered once, as "Shader" (ShaderAsset::kAssetTypeName). Its second name, "ShaderAsset", was there because the reflection named an AssetRef<ShaderAsset> by its class; it no longer does (engine changelog).
Added
- GL::GenerateMipmap, gl::LINEAR_MIPMAP_LINEAR and gl::NEAREST_MIPMAP_NEAREST, for filtered textures.
- A source's filter (QuadBlit::Source::filter: Point, Bilinear, Trilinear, the image's setting). GLBlitSink draws Bilinear blended between the four nearest texels, and Trilinear also between mipmaps by how small it is drawn, kept within each source so a frame or tile never takes in its neighbour's texels; a texture gets its mipmaps when a Trilinear source first draws from it. The CPU draws Point, as before.
- Lights: the Light component (Ambient, Directional, Point, Spot; colour, intensity, range, a spot's angle and softness, a sun's yaw and pitch, 2D bands, shadows). Every active Light in the scene lights deki-3d's meshes and the 2D world; a scene with none is lit as before, not at all.
- The 2D light, Lighting2D: worked out per 4x4 block, blended and dithered between blocks where it changes, up to twice a colour, laid over the frame by Standard2DRenderer before the first object above the camera's litUpToSortOrder (new; the default lights everything) or before a renderer that LightsItself() (new, on RendererComponent). Strips and redraws of part of the frame are lit as the whole frame, and a changed light is a changed region. On a device both cores light the pixels.
- On the GPU the 2D light is a full-screen pass, per pixel (QuadBlit::BlitSink::Light, QuadBlit::LightSinkFrame, the presenter's 2D light program, HLSL in editor/Light2DShader.cpp, compiled into GLLight2DShader.inl). A sink that cannot light says so, once.
- In the editor: the Light inspector and its gizmos (a point's reach, a spot's cone), and a check of the scenes a build ships that lists each shadow-casting light a board without OpenGL draws without its shadows.
- OpenGL, where the platform provides opengl (its build then defines DEKI_CAPABILITY_OPENGL; a board never does and compiles none of it): the GL loader and shared context (GLApi.h), a presenter that builds each frame on the GPU (GLPresenter), the 2D drawn there too (GLBlitSink), and ScreenEffect, a full-screen shader over the finished frame. Types live in DekiGL.
- ShaderAsset (.shader): a GPU shader, written in HLSL. The editor compiles it (Slang, then SPIRV-Cross) to GLSL ES 3.00 and GLSL 3.30 for each use whose hooks it defines (editor/ShaderUses.h: deki-3d's meshes, screen effects), and the asset is that GLSL. Errors name the file and line, in the Console and in a build's problems; a build for a target without OpenGL that ships a scene using a shader stops. The editor lists it as the Shader asset type.
- A blit sink (QuadBlit::BlitSink), so a GPU that builds the frame (GLPresenter) can draw its 2D. While a sink frame is on (QuadBlit::BeginSinkFrame), every Blit and BlitScaled into that frame's buffer goes to the sink, worked out as the CPU would draw it (SinkBlit: the clipped rectangle and the 16.16 steps it samples with), and nothing reaches the buffer. Without a sink a blit tests one pointer more and nothing else changes.
- DekiRenderSystem draws the whole frames of a camera that clears into a sink that takes them: the clear is the sink's, and the buffer starts empty (transparent) and collects only what code writes into it directly. Redrawing only what changed is skipped then, as the sink's frame starts over each time. Strips and a camera that keeps its frame stay on the CPU.
- RenderPass::WritesBuffer: whether a pass writes into the buffer other than through QuadBlit. On a sink frame the renderer tells the sink after each hook of a pass that does (QuadBlit::NoteWritten), so what it wrote is composed in its place in the draw order. Yes by default; a pass that draws only through QuadBlit says no and saves a look through the buffer.
- QuadBlit::Source::revision and QuadBlit::NextRevision(): a number for a source's pixels, new whenever they are written, so a sink keeps its upload until it changes. ForgetScaled tells the sink too.
Changed
- QuadBlit's row loops stay where they are meant to on an ESP32. Each one Blit or BlitScaled calls is in IRAM and never inlined into those callers, which run from flash; before, the compiler inlined some of them and dropped their IRAM copy, and which ones changed with any edit nearby (the 1:1 alpha blend of RGB565A8 sprites ran from flash). The general per-pixel path (BlitRows) is in flash, as it was in every build: in IRAM it took 12 KB and drew Wyrdmoor on a T-Deck no faster. IRAM on a T-Deck build: 2.4 KB more.
이전 릴리스: CHANGELOG.md
패키지의 리플렉션 데이터에서 생성했습니다(엔진 0.40.1). 속성 이름은 씬 파일에서 쓰는 키입니다. 이름을 바꿔도 별칭이 유지됩니다(호환성).