载入中...
搜索中...
未找到

#include <Graphics.h>

类 eve::graphics::Graphics 继承关系图:
eve::Module eve::graphics::Canvas eve::IWindowSurfaceHost eve::graphics::IGraphics2D eve::graphics::IGraphics3D eve::graphics::IResourceFactory eve::graphics::IPostFX eve::graphics::Drawable eve::graphics::vulkan::Graphics eve::graphics::webgpu::Graphics

struct  EntityIdDraw
 Per-pixel mesh entity-ID pass. Renders each EntityIdDraw's mesh with the given flat idColor (RGB encodes a stable entity id) into an offscreen target using the same viewProj, then reads it back to CPU. Pixels not covered by any entity are (0,0,0,0). Caller owns the returned ImageData*. Returns nullptr when the backend does not support offscreen ID capture. 更多...
 

Public 类型

using WindowDestroyedCallback = void(*)(void *userdata)
 Register a callback invoked when the native window is destroyed. Used by the UI backend to tear down its ImGui context; callbacks are cleared (and invoked) on onNativeWindowDestroyed().
 
using PresentOverlayFn = void(*)(void *userdata, void *commandBuffer)
 Optional overlay drawn inside the swapchain render pass (before end). Used by declarative UI (ImGui). commandBuffer is a VkCommandBuffer as void*.
 

Public 成员函数

 Module_REG (Graphics)
 
 Graphics ()
 
 ~Graphics () override
 
virtual void reset ()
 Resets the current color, background color, line style, and so forth.
 
virtual void clearScreen ()
 Script-friendly wrappers (r,g,b[,a] floats — no Color type in Squirrel).
 
virtual void setBackgroundColorRGBA (float r, float g, float b, float a=1.f)
 
virtual void drawSolidRectRGBA (float x, float y, float w, float h, float r, float g, float b, float a=1.f)
 
virtual void drawTexturedRectRGBA (Texture *texture, float x, float y, float w, float h, float r, float g, float b, float a=1.f)
 
TexturenewTextureFromImageData (image::ImageData *data, bool repeatU=false, bool repeatV=false)
 
TexturenewTextureFromImageData (image::ImageData *data, const TextureCreateInfo &info)
 Upload RGBA8 ImageData with mipmaps / filter / anisotropy options.
 
TexturenewTextureWithSampler (image::ImageData *data, bool repeatU, bool repeatV, bool generateMipmaps, float maxAnisotropy, const std::string &filter, const std::string &mipmap, float lodBias=0.f)
 Script-friendly texture create: filter = "linear"|"nearest", mipmap = "none"|"linear"|"nearest". generateMipmaps builds a full mip chain; maxAnisotropy > 1 enables anisotropic filtering.
 
virtual void setTextureSamplerParams (Texture *texture, const std::string &filter, const std::string &mipmap, float maxAnisotropy, float lodBias)
 Update sampler state without re-uploading pixels (filter / mip / aniso / LOD bias).
 
virtual void present ()=0
 
virtual std::string getBackendName () const =0
 Renderer backend id used by sibling modules (e.g. Gpgpu).
 
virtual bool supportsGBufferPost () const
 Whether gbuffer-based post-process shaders (AO, GI) can be created on this backend. False on WebGPU, whose custom post shaders are WGSL-only (the built-in AO/GI use SPIR-V), so RenderSystem3D skips them there.
 
virtual void initWithWindow (void *nativeWindow)=0
 Bind to an existing native window (SDL_Window*) and create Vulkan device/swapchain. Must be called after the window exists (SDL_WINDOW_VULKAN).
 
virtual void setViewportSize (int width, int height, int pixelwidth, int pixelheight)=0
 Sets the current graphics display viewport dimensions.
 
int getWidth () const
 
int getHeight () const
 
int getPixelWidth () const
 
int getPixelHeight () const
 
double getCurrentDPIScale () const
 
double getScreenDPIScale () const
 
virtual void drawSolidRect (float x, float y, float w, float h, const Color &color, BlendMode blend=BlendMode::Alpha)=0
 Internal immediate-mode helper used by RenderSystem / Batcher.
 
virtual void drawSolidRectRotated (float cx, float cy, float w, float h, float degrees, const Color &color, BlendMode blend=BlendMode::Alpha)=0
 Rotated solid quad degrees clockwise (screen Y-down) around (cx, cy).
 
virtual TexturenewTexture (int width, int height, const uint8_t *rgba, bool repeatU=false, bool repeatV=false)=0
 
virtual TexturenewTexture (int width, int height, const uint8_t *rgba, const TextureCreateInfo &info)=0
 
virtual TexturenewCubemap (int faceSize, const uint8_t *rgbaFaces)=0
 Create an RGBA8 cubemap from 6 faces packed as +X,-X,+Y,-Y,+Z,-Z (each faceSize×faceSize, total bytes = faceSize²×4×6). Owned by Graphics.
 
virtual TexturenewCubemap (int faceSize, const uint8_t *rgbaFaces, const TextureCreateInfo &info)=0
 Cubemap with mipmap / sampler options (IBL-friendly when generateMipmaps=true).
 
virtual TexturenewTexture (image::ImageData *data)=0
 Create texture from ImageData (RGBA8 required for now).
 
virtual TexturenewTexture (image::ImageData *data, const TextureCreateInfo &info)=0
 Create texture from ImageData with sampler / mipmap options.
 
virtual void setTextureSampler (Texture *texture, const TextureSampler &sampler)=0
 Recreate the sampler for an existing texture (keeps image / mip chain). No-op when texture is null or not owned by this Graphics.
 
virtual float getMaxAnisotropy () const =0
 Device max supported anisotropy (1 if unsupported). Valid after initWithWindow.
 
virtual TexturenewTextureFromFile (const std::string &filename)=0
 
TexturenewTextureFromFileRepeated (const std::string &filename, bool repeatU, bool repeatV)
 
virtual bool reloadTextureFromFile (const std::string &filename)=0
 Reload a path-cached texture from disk in place (pointer stable). False if unbound.
 
virtual bool releaseTexture (Texture *texture)
 Eagerly releases a texture created by this Graphics.
 
virtual void drawTexturedRect (Texture *texture, float x, float y, float w, float h, const Color &color)=0
 
virtual void drawTexturedRectShader (Texture *texture, Shader *shader, float x, float y, float w, float h, const Color &color)=0
 Draw with an explicit Shader (nullptr = default textured pipeline).
 
virtual void drawTexturedRectUV (Texture *texture, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const Color &color)=0
 Draw a textured sub-rect (atlas / tile UVs). texture may be null → solid.
 
virtual void drawTexturedRectShaderUV (Texture *texture, Shader *shader, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const Color &color, bool rotatedUV=false, BlendMode blend=BlendMode::Alpha)=0
 UV draw with an explicit Shader (nullptr = default textured pipeline).
 
virtual void drawTexturedRectShaderUVRotated (Texture *texture, Shader *shader, float cx, float cy, float w, float h, float degrees, float u0, float v0, float u1, float v1, const Color &color, bool rotatedUV=false, BlendMode blend=BlendMode::Alpha)=0
 UV draw rotated degrees clockwise (screen Y-down) around the rect center. texture may be null → solid. Shader nullptr = default textured pipeline.
 
virtual void drawTexturedRectShaderDepth (Texture *color, Texture *depth, Shader *shader, float x, float y, float w, float h, const Color &tint)=0
 Fullscreen/post draw sampling color at binding 0 and depth at binding 1 (hardware D32, .r = Vulkan NDC z). depth may be null → color is bound twice.
 
virtual void drawTexturedRectLitUV (Texture *albedo, Texture *normal, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const Color &color)=0
 Lit 2D draw (albedo + normal map). Uses Lighting2DUBO from setLighting2D. normal may be null → treated as flat (0.5,0.5,1) only if a default normal tex exists.
 
virtual void setLighting2D (const Lighting2DUBO &ubo)=0
 Upload per-frame / per-canvas 2D lighting constants for subsequent lit draws.
 
QuadnewQuad (int x, int y, int w, int h)
 Pixel-space atlas rect. Caller owns Quad* (not tracked by Graphics).
 
virtual MeshnewMeshFromAssimp (const ::aiMesh &mesh)=0
 
virtual MeshnewMeshFromAssimp (const ::aiMesh &mesh, const aiMatrix4x4 &worldTransform)=0
 Like newMeshFromAssimp, but bakes an Assimp node world transform into positions and transforms normals by the inverse-transpose of the upper 3x3. Required for hierarchical glTF/FBX scenes — raw aiMesh verts are in local space.
 
virtual MeshnewMeshFromArrays (const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount)=0
 Upload a triangle mesh from packed CPU arrays. Owned by Graphics. posXYZ required (vertexCount*3). nrmXYZ/uvST may be null (flat normal / zero UV). indices required (indexCount, triangles).
 
virtual bool updateMeshVertices (Mesh *mesh, const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount)=0
 In-place update of a mesh's vertex/index data (CPU -> host-visible VBO). Mirrors bakeMeshMorph: the update synchronizes with in-flight GPU work, so prefer rebuilding only when content actually changes. The mesh's buffer is reused while it fits (stable GPU handle) and reallocated when the new size grows. Returns false when unsupported (WebGPU backend). posXYZ/nrmXYZ follow newMeshFromArrays layout (uvST may be null); indices/indexCount may be null/0 to keep the mesh's existing indices.
 
virtual bool bakeMeshMorph (Mesh *mesh)=0
 If mesh morph weights are dirty, bake blended positions and upload to the GPU VBO. Returns true when an upload happened. No-op when no morph data / not dirty / null.
 
virtual MeshnewMeshSphere (int slices=32, int stacks=16)=0
 Procedural UV sphere (radius 1, Y-up). Owned by Graphics. slices = longitude divisions, stacks = latitude divisions.
 
virtual MeshnewMeshCylinder (int slices=32, int stacks=1, bool caps=true)=0
 Procedural Y-up cylinder (radius 1, height 2 centered at origin). slices = longitude divisions; stacks = height bands; caps = include end discs. Owned by Graphics.
 
MeshnewMeshCube (float size=1.f)
 Procedural cube (edge length size, centered at origin, outward CCW for RH Y-up), with per-face normals and a full 0..1 UV per face. Owned by Graphics.
 
virtual bool releaseMesh (Mesh *mesh)
 Eagerly releases a mesh created by this Graphics.
 
virtual void render3D ()
 Run RenderSystem3D (begin3DFrame + draw visible Renderable3D).
 
virtual void renderScene3DToCanvas (Canvas *canvas, Camera3D *camera)
 
virtual void setDirectionalLight (float dx, float dy, float dz, float r=1.f, float g=1.f, float b=1.f)
 
virtual void drawScene3DRGBA (float x, float y, float w, float h, float r=1.f, float g=1.f, float b=1.f, float a=1.f)
 Composite this frame's 3D scene color into a rect (screen or active Canvas). virtual * Call after render3D(); order vs drawSolidRect / drawTexturedRect is preserved. If never called, present() still blits the 3D scene fullscreen under 2D. RGB is blitted opaque (scene A is linear depth, not transparency).
 
void drawScene3D (float x, float y, float w, float h)
 Script-friendly 4-arg form (simplesquirrel does not apply C++ defaults).
 
virtual void drawCanvasRGBA (Canvas *canvas, float x, float y, float w, float h, float r=1.f, float g=1.f, float b=1.f, float a=1.f)
 Draw a Canvas color buffer as a textured rect (same batch order as other 2D).
 
void drawCanvas (Canvas *canvas, float x, float y, float w, float h)
 
virtual void pushValidationScope ()=0
 Backend hooks so the platform-independent render3D() can wrap its work in a GPU validation error scope (used on WebGPU to catch early device errors).
 
virtual void popValidationScope ()=0
 
MaterialnewMaterial ()
 Create a Material asset (shading model + textures + PBR knobs). Caller owns Material*; not tracked by Graphics.
 
RenderControlgetRenderControl ()
 Shared compilable 3D render control (features → pass list + GBuffer). Owned by Graphics; valid for the module lifetime.
 
virtual void beginGBufferPass (int width, int height)=0
 Depth/normal(/albedo) fill pass for mid/post effects. One-shot submit (like shadow); call before begin3DFrame when enabled. After endGBufferPass, textures are available via getRenderControl()->getGBuffer().
 
virtual void drawMeshGBuffer (Mesh *mesh, const glm::mat4 &mvp, const glm::mat4 &model, float nearZ, float farZ, Texture *albedo=nullptr, float tintR=1.f, float tintG=1.f, float tintB=1.f)=0
 
virtual void drawMeshGBufferAlpha (Mesh *mesh, const glm::mat4 &mvp, const glm::mat4 &model, float nearZ, float farZ, Texture *albedo=nullptr, float tintR=1.f, float tintG=1.f, float tintB=1.f)=0
 GBuffer fill with alpha-cutout discard (card/billboard geometry such as sprite-stack slices): same outputs as drawMeshGBuffer, but transparent texels are discarded so depth/normal follow the silhouette. No-op on backends without the alpha pipeline (WebGPU).
 
virtual void endGBufferPass ()=0
 
virtual void begin3DFrame ()=0
 Begin a 3D frame: shadow/gbuffer (if pending) then a sampleable scene color pass (color+depth). Leaves the pass open for drawMesh and a following RenderSystem::render (2D). Does not present. flushToSwapchain resolves the scene color (FXAA when "aa" is on) into the swapchain, then draws 2D overlays. Soft-fails (no throw) when the swapchain cannot be acquired yet — check had3DThisFrame().
 
virtual void begin3DFrameToCanvas (Canvas *canvas)=0
 Open a 3D render pass targeting an offscreen Canvas (color + depth) at the canvas size. Uses setMesh3DViewProj/View/CameraPos/Env as the camera. Draw meshes with drawMeshShader, then call end3DFrameToCanvas(). The canvas texture then holds the rendered scene (e.g. a planar reflection). Unsupported if canvas is not an offscreen canvas (screen).
 
virtual void end3DFrameToCanvas ()=0
 
virtual void setMesh3DViewProj (const glm::mat4 &viewProj)=0
 
virtual void setMesh3DView (const glm::mat4 &view)=0
 Camera view matrix for subsequent drawMesh (view-space depth / CSM select).
 
virtual void setMesh3DClip (float nearZ, float farZ)=0
 Near/far used to pack linear depth into scene color A (SSGI).
 
virtual TexturegetSceneColorTexture ()
 Sampleable 3D color target for the current frame (RGB = lit, A = linear depth). Valid after begin3DFrame until present; nullptr when 3D did not run offscreen.
 
virtual image::ImageDatarenderEntityIdMask (const std::vector< EntityIdDraw > &draws, const glm::mat4 &viewProj, int width, int height)
 
virtual image::ImageDatareadGBufferToImageData (const std::string &name)
 Read a G-buffer attachment back to CPU as RGBA8. name is one of "depth" (RGBA8 linear depth), "normal" (world normal*0.5+0.5), "albedo". Valid only after a G-buffer or entity-ID offscreen pass filled it. Caller owns the returned ImageData*. Returns nullptr when unsupported.
 
virtual void drawMesh (Mesh *mesh, const glm::mat4 &model, Texture *texture, const Color &tint)=0
 Draw one mesh with model matrix. Requires begin3DFrame() (or an open swapchain pass).
 
virtual void drawMeshShader (Mesh *mesh, const glm::mat4 &model, Texture *texture, const Color &tint, Shader *shader)=0
 Draw mesh with an explicit Mesh3D Shader (nullptr = default PBR pipeline).
 
virtual void setMesh3DNormalTexture (Texture *normal)=0
 Optional normal map for the next drawMesh / drawMeshShader (nullptr = flat).
 
virtual void setMesh3DHeightTexture (Texture *height)=0
 Optional height map for parallax (R channel; nullptr = flat / off).
 
virtual void setMesh3DSceneDepth (Texture *depth)=0
 Optional scene hardware depth (G-buffer hwDepth, Vulkan NDC z) bound to mesh3d shader binding 7. X-ray mesh shaders sample it to discard visible (non-occluded) fragments. nullptr falls back to a placeholder.
 
virtual void setMesh3DMaterial (float metallic, float roughness)=0
 Metallic (0..1) and roughness (0..1) for the next default mesh draw.
 
virtual void setMesh3DTexCellBomb (float cellScale, float strength, float rotAmount=1.f)=0
 Texture cell bombing for the next default mesh draw (breaks tiling). cellScale: cells per UV unit (typical 2..16). strength: 0=off, 1=full. rotAmount: 0..1 per-cell rotation scale (default 1).
 
virtual void setMesh3DParallax (float scale, float minLayers=8.f, float maxLayers=32.f)=0
 Parallax occlusion mapping for the next default mesh draw. scale: UV displacement strength (0=off). Typical 0.02..0.08. minLayers / maxLayers: adaptive POM ray-march steps (more when glancing).
 
virtual void setMesh3DLighting (const Lighting3DPack &pack)=0
 Per-frame ambient + up to 8 lights packed into Mesh3DUBO.
 
virtual void setCloudShadows (float strength, float worldCell, float time, float windSpeed, float windAngle, float coverage, float detail)=0
 Dynamic cloud shadows cast on the ground by the default PBR mesh path. strength 0 disables (no change to rendering). time advances wind drift. Packed into Mesh3DUBO.cloud / cloudWind and consumed by mesh3d shaders.
 
virtual void setMesh3DClusteredLighting (const ClusteredLightingUpload &upload)=0
 Enable clustered forward path for subsequent default mesh draws (SSBO light lists). Pass upload.active=false (or empty) to disable and return to the ≤8 UBO path.
 
virtual void setMesh3DClusteredActive (bool active)=0
 Cheap per-draw toggle for the already-uploaded clustered light table. Unlike setMesh3DClusteredLighting it never re-uploads SSBO data, so the per-frame clustered build happens exactly once per camera.
 
virtual void setMesh3DLight (const glm::vec3 &dir, const glm::vec3 &color)=0
 Directional light for subsequent drawMesh calls (world-space direction toward surface).
 
virtual void setMesh3DCameraPos (const glm::vec3 &eye)=0
 Camera eye used by mesh shaders that need view/rim (stored in Mesh3DUBO).
 
virtual void drawVoxelFaceInstances (const uint32_t *packed, int count, float originX, float originY, float originZ, const std::string &faceDir, Texture *atlas, int tilesPerRow=16, const uint32_t *ao=nullptr)=0
 Instanced voxel face rectangles (32-bit packed instances). ao: optional per-instance ambient-occlusion words (2 bits per corner, 0..3, shader corner order); null → full bright. faceDir: "posX"|"negX"|"posY"|"negY"|"posZ"|"negZ" (also "+x"/"-x"/…). Requires begin3DFrame(); uses viewProj from setMesh3DViewProj. atlas may be null → white; tilesPerRow subdivides atlas for texture indices.
 
virtual void setMesh3DEnv (Texture *cube, float intensity)=0
 Specular IBL environment for subsequent default mesh draws. cube must be from newCubemap (or nullptr → black / intensity 0). intensity is packed into Mesh3DUBO lightColor.w.
 
virtual void setMesh3DShadows (const ShadowUpload &upload)=0
 Upload CSM constants for subsequent default mesh draws (active=false disables).
 
virtual void setMesh3DShadowReceive (bool receive)=0
 Per-draw: when false, shadow sampling is forced off for the next mesh draw.
 
virtual void beginShadowPass (int cascadeIndex)=0
 Depth-only shadow pass for one cascade layer (0..2). Draws are recorded into the next begin3DFrame command buffer (ping-pong map per frame slot). Call before begin3DFrame.
 
virtual void drawMeshShadow (Mesh *mesh, const glm::mat4 &lightMVP)=0
 
virtual void drawMeshShadowAlpha (Mesh *mesh, const glm::mat4 &lightMVP, Texture *albedo=nullptr)=0
 Shadow pass draw with alpha-cutout discard (card/billboard geometry such as sprite-stack slices): transparent texels of albedo are discarded so the slice casts a silhouette shadow instead of a solid quad. Requires an active shadow pass (beginShadowPass). No-op on backends without the alpha shadow pipeline (WebGPU).
 
virtual void endShadowPass ()=0
 
bool consumeFrameHad3D ()
 True after begin3DFrame until present completes.
 
bool had3DThisFrame () const
 
Color getBackgroundColor () const
 
void setBackgroundColor (const Color &c)
 
virtual void setScreenReadbackEnabled (bool enabled)
 When true, each present copies the swapchain to a CPU buffer for getPixel/newImageData. Default false — full-frame readback is expensive; enable only for tests / tools.
 
bool isScreenReadbackEnabled () const
 
bool saveFramePng (const std::string &path)
 Save the last presented frame to a PNG at path. Enables screen readback if needed. Returns false if no presented frame is available or encoding fails.
 
virtual void setVSync (bool enabled)
 Prefer uncapped present (IMMEDIATE/MAILBOX) when false, vsync (MAILBOX/FIFO) when true. Takes effect on the next swapchain recreate.
 
bool isVSync () const
 
virtual void setMsaaSamples (int samples)
 Hardware MSAA sample count for the 3D scene color pass (0 disables, then 2/4/8 are used when the device supports them). 0 or 1 mean no MSAA. Takes effect on the next begin3DFrame.
 
virtual int getMsaaSamples () const
 
void setActive (bool active) override
 Pause/resume presenting (Android background / foreground).
 
bool isActive () const
 
virtual void markSwapchainDirty ()
 Request swapchain recreation on next present/begin3DFrame.
 
void requestSurfaceRecreate () override
 Request recreation of the platform render surface on the next frame (Android background/foreground destroys the native window). Safe to call from a non-render thread; the actual work happens on the render thread.
 
virtual void onNativeWindowDestroyed ()
 Called by the Window module when the native window backing the render surface is destroyed (window close / recreation). Backends that keep a platform surface tied to the native window must drop it here so the next initWithWindow() rebuilds it against a fresh window — even when SDL hands back the same pointer for the recreated window.
 
void clearPresentOverlay ()
 Drop the present overlay callback (window gone; re-register on UI init).
 
void addWindowDestroyedCallback (WindowDestroyedCallback cb, void *userdata)
 
void setPresentOverlay (PresentOverlayFn fn, void *userdata)
 
PresentOverlayFn getPresentOverlay () const
 
void * getPresentOverlayUser () const
 
FontnewFont (font::FontData *data, std::string charset=Font::defaultCharset())
 Build a GPU font (glyph atlas texture) from decoded font data. Rasterizes charset (UTF-8, default: printable ASCII) up front; virtual * codepoints outside it still advance in print() but aren't drawn. Caller owns Font* (not tracked by Graphics — unlike newTexture / newMesh / newShader handles, which Graphics owns).
 
virtual void setFont (Font *font)
 Font used by subsequent print() calls; nullptr = none set.
 
FontgetFont () const
 
virtual void print (const std::string &text, float x, float y, const Color &color=Color(1.f, 1.f, 1.f, 1.f), float scale=1.f)
 Draws UTF-8 text with the current font (see setFont), baseline-aligned so that (x,y) is the top-left of the line. Throws if no font is set.
 
virtual void setShader (Shader *shader)
 Custom fragment pipeline for subsequent textured 2D draws.
 
virtual void setShader ()
 
ShadergetShader () const
 
virtual ShadernewShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv)=0
 Create a custom 2D shader from SPIR-V words (vert + frag). Owned by Graphics. Vertex stage may be empty → uses the default textured vertex shader.
 
virtual ShadernewShaderFromSpvFile (const std::string &vertPath, const std::string &fragPath)=0
 Load SPIR-V from files via Filesystem (empty vertPath → default textured vert).
 
ShadernewShaderFromSpvFile (const std::string &fragPath)
 
virtual ShadernewShader (const std::string &vertGlsl, const std::string &fragGlsl)=0
 Compile GLSL source with glslc (must be on PATH). Empty vertGlsl → default textured vert. Throws if compilation fails.
 
ShadernewShader (const std::string &fragGlsl)
 
virtual ShadernewMeshShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv)=0
 Create a Mesh3D custom shader (MeshVertex + Frame UBO + albedo). Empty vert → default mesh3d.vert. Owned by Graphics.
 
virtual ShadernewMeshShaderFromWgsl (const std::string &vertWgsl, const std::string &fragWgsl)=0
 Create a Mesh3D custom shader from WGSL source (WebGPU backend). The WGSL must declare the engine's Frame UBO (group 0 binding 0) and the shared mesh3d bindings (albedo 1, normal 2, env 3, shadow UBO 4, shadow depth 5, height 6, main sampler 7, shadow compare sampler 8, scene depth 9). Vulkan throws (uses SPIR-V via newMeshShaderFromSpv).
 
virtual ShadernewMeshShader (const std::string &vertGlsl, const std::string &fragGlsl)=0
 
ShadernewMeshShader (const std::string &fragGlsl)
 
virtual ShadernewHairShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv)=0
 Hair/fur card shader (alpha blend + Kajiya-Kay). Empty vert → mesh3d_hair.vert. Owned by Graphics.
 
ShadernewHairShader ()
 Built-in hair shader with default anisotropic parameters.
 
virtual bool releaseShader (Shader *shader)
 Eagerly releases a shader created by this Graphics.
 
ShadernewGrassShader ()
 t3ssel8r-style grass billboard shader (alpha test + shadow two-tone). Owned by Graphics. See grass:: / GrassField.
 
GrassFieldnewGrassField ()
 Dense + sparse stylized grass field. Caller owns GrassField*; its Mesh / Shader / Texture are owned by Graphics.
 
WaterfallnewWaterfall ()
 Flowing waterfall (falling water sheet) with sky reflection, downward velocity streaks and animated foam at the top lip and bottom splash pool. Caller owns Waterfall*; its Mesh / Shader are owned by Graphics.
 
WaternewWater ()
 Dynamic water surface (sky reflection + animated edge waves + middle drop ripples). Caller owns Water*; its Mesh / Shader are owned by Graphics.
 
virtual CanvasnewCanvas (int width, int height)=0
 Create an offscreen render target (sampleable). Owned by Graphics.
 
virtual void setCanvas (Canvas *canvas)=0
 nullptr or this → screen. Switching flushes pending draws to the previous target.
 
void setCanvas ()
 
virtual bool isCanvasActive () const =0
 
virtual CanvasgetCanvas () const =0
 
VolumetricnewVolumetric ()
 Volumetric light + fog (screenspace / raymarch / fog). Caller owns Volumetric*; its Shaders are owned by Graphics.
 
AmbientOcclusionnewAmbientOcclusion ()
 Screen-space ambient occlusion (ssao / hbao / gtao). Caller owns AmbientOcclusion*; its Shaders are owned by Graphics.
 
OutlinenewOutline ()
 Screen-space model outline (t3ssel8r-style) from GBuffer depth + normal. Caller owns Outline*; its Shader is owned by Graphics.
 
GlobalIlluminationnewGlobalIllumination ()
 Screen-space single-bounce GI. Caller owns GlobalIllumination*; its Shaders are owned by Graphics.
 
ScreenSpaceReflectionnewScreenSpaceReflection ()
 Screen-space reflections (ray-marched over scene color + hw depth). Caller owns ScreenSpaceReflection*; its Shader is owned by Graphics.
 
AmbientOcclusionpipelineAmbientOcclusion ()
 Pipeline-owned AO / GI / AA used by RenderSystem3D when features "ao" / "gi" / "aa" are enabled. Created on first use; Graphics owns them.
 
GlobalIlluminationpipelineGlobalIllumination ()
 
AntiAliasingpipelineAntiAliasing ()
 
OutlinepipelineOutline ()
 Pipeline-owned Outline used by RenderSystem3D when the "outline" feature is on.
 
AntiAliasingnewAntiAliasing ()
 Classic image-space AA (FXAA / SMAA / SSAA / NFAA). Caller owns AntiAliasing*; its Shaders are owned by Graphics.
 
virtual void draw (Drawable *drawable, const glm::mat4 &m)
 
virtual void drawOcclusion (Drawable *drawable, const glm::mat4 &m)
 Volumetric occlusion helpers (shadow-pass analogue for light shafts). drawOcclusion skips drawables with castOcclusion=false.
 
virtual void drawOcclusionSolid (float x, float y, float w, float h)
 
virtual void drawOcclusionTexture (Texture *texture, float x, float y, float w, float h)
 
void points (const std::vector< glm::vec2 > &positions, const std::vector< Color > &colors)
 Draws a series of points at the specified positions.
 
void polyline (const glm::mat4 *vertices, size_t count)
 Draws a series of lines connecting the given vertices.
 
void rectangle (std::string mode, float x, float y, float w, float h)
 Draws a rectangle.
 
void rectangle (std::string mode, float x, float y, float w, float h, float rx, float ry, int points)
 Variant of rectangle that draws a rounded rectangle.
 
void rectangle (std::string mode, float x, float y, float w, float h, float rx, float ry)
 
void circle (std::string mode, float x, float y, float radius, int points)
 Draws a circle using the specified arguments.
 
void circle (std::string mode, float x, float y, float radius)
 
void ellipse (std::string mode, float x, float y, float a, float b, int points)
 Draws an ellipse using the specified arguments.
 
void ellipse (std::string mode, float x, float y, float a, float b)
 
void arc (std::string mode, std::string arcmode, float x, float y, float radius, float angle1, float angle2, int points)
 Draws an arc using the specified arguments.
 
void arc (std::string mode, std::string arcmode, float x, float y, float radius, float angle1, float angle2)
 
void polygon (std::string mode, const std::vector< glm::vec2 > &vertices, bool skipLastFilledVertex=true)
 Draws a polygon with an arbitrary number of vertices.
 
void push (bool all)
 
void pop ()
 
const glm::mat4 & getTransform () const
 
const glm::mat4 & getProjection () const
 
void rotate (float r)
 
void scale (float x, float y=1.0f)
 
void translate (float x, float y)
 
void origin ()
 
glm::vec2 transformPoint (glm::vec2 point)
 
glm::vec2 inverseTransformPoint (glm::vec2 point)
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 
virtual std::string getName () const =0
 
- Public 成员函数 继承自 eve::graphics::Canvas
 Canvas ()
 
 ~Canvas () override
 
virtual TexturegetTexture ()=0
 Sampleable color buffer; screen Canvas returns nullptr.
 
virtual void clear (std::optional< Color > color, std::optional< int > stencil, std::optional< double > depth)=0
 
virtual Color getPixel (int x, int y)=0
 
virtual image::ImageDatanewImageData ()=0
 
virtual void draw (Canvas *C, const glm::mat4 &matrix) const =0
 
- Public 成员函数 继承自 eve::graphics::Drawable
virtual ~Drawable ()
 
virtual void draw (Graphics *gfx, const glm::mat4 &matrix) const =0
 Draws the object with the specified transformation matrix.
 
bool getCastOcclusion () const
 When false, skipped by Graphics::drawOcclusion / volumetric occluder passes.
 
void setCastOcclusion (bool cast)
 
virtual void drawOcclusion (Graphics *gfx, const glm::mat4 &matrix) const
 Draw as an opaque black silhouette for volumetric occlusion maps (screen-space god rays / light shafts). Default is a no-op; Texture / Mesh override with 2D black rects (alpha preserved for textures).
 
- Public 成员函数 继承自 eve::IWindowSurfaceHost
virtual ~IWindowSurfaceHost ()=default
 
- Public 成员函数 继承自 eve::graphics::IGraphics2D
virtual ~IGraphics2D ()=default
 
- Public 成员函数 继承自 eve::graphics::IGraphics3D
virtual ~IGraphics3D ()=default
 
- Public 成员函数 继承自 eve::graphics::IResourceFactory
virtual ~IResourceFactory ()=default
 
- Public 成员函数 继承自 eve::graphics::IPostFX
virtual ~IPostFX ()=default
 

Protected 成员函数

ShaderprepareSceneColorResolveShader (Texture *scene)
 FXAA resolve shader that writes opaque RGB (ignores scene-color depth alpha).
 

Protected 属性

int width = 0
 
int height = 0
 
int pixelWidth = 0
 
int pixelHeight = 0
 
Color backgroundColor {0.1f, 0.1f, 0.12f, 1.0f}
 
bool frameHad3D = false
 
bool recordingEngine3D_ = false
 True while RenderSystem3D is submitting (AO / engine overlays).
 
bool screenReadbackEnabled = false
 
bool vsyncEnabled = true
 
bool graphicsActive = true
 
int msaaSamples = 4
 
PresentOverlayFn presentOverlayFn_ = nullptr
 
void * presentOverlayUser_ = nullptr
 
std::vector< std::pair< WindowDestroyedCallback, void * > > windowDestroyedCallbacks_
 
ShadercurrentShader = nullptr
 
FontcurrentFont = nullptr
 
std::unique_ptr< RenderControlrenderControl_
 
std::unique_ptr< AmbientOcclusionpipelineAO_
 
std::unique_ptr< GlobalIlluminationpipelineGI_
 
std::unique_ptr< AntiAliasingpipelineAA_
 
std::unique_ptr< OutlinepipelineOutline_
 

额外继承的成员函数

- 静态 Public 属性 继承自 eve::IWindowSurfaceHost
static constexpr const char * capabilityName = "IWindowSurfaceHost"
 

详细描述

在文件 Graphics.h50 行定义.

成员类型定义说明

◆ PresentOverlayFn

using eve::graphics::Graphics::PresentOverlayFn = void (*)(void *userdata, void *commandBuffer)

Optional overlay drawn inside the swapchain render pass (before end). Used by declarative UI (ImGui). commandBuffer is a VkCommandBuffer as void*.

在文件 Graphics.h672 行定义.

◆ WindowDestroyedCallback

using eve::graphics::Graphics::WindowDestroyedCallback = void (*)(void *userdata)

Register a callback invoked when the native window is destroyed. Used by the UI backend to tear down its ImGui context; callbacks are cleared (and invoked) on onNativeWindowDestroyed().

在文件 Graphics.h663 行定义.

构造及析构函数说明

◆ Graphics()

eve::graphics::Graphics::Graphics ( )

◆ ~Graphics()

eve::graphics::Graphics::~Graphics ( )
override

在文件 Graphics.cpp106 行定义.

成员函数说明

◆ addWindowDestroyedCallback()

void eve::graphics::Graphics::addWindowDestroyedCallback ( WindowDestroyedCallback  cb,
void *  userdata 
)
inline

在文件 Graphics.h664 行定义.

引用了 windowDestroyedCallbacks_.

被这些函数引用 eve::ui::ImGuiBackend::init().

◆ arc() [1/2]

void eve::graphics::Graphics::arc ( std::string  mode,
std::string  arcmode,
float  x,
float  y,
float  radius,
float  angle1,
float  angle2 
)

◆ arc() [2/2]

void eve::graphics::Graphics::arc ( std::string  mode,
std::string  arcmode,
float  x,
float  y,
float  radius,
float  angle1,
float  angle2,
int  points 
)

Draws an arc using the specified arguments.

参数
drawmodeThe mode of drawing (line/filled).
arcmodeThe type of arc.
xX-coordinate.
yY-coordinate.
radiusRadius of the arc.
angle1The angle at which the arc begins.
angle2The angle at which the arc terminates.
pointsNumber of points to use to draw the arc.

◆ bakeMeshMorph()

virtual bool eve::graphics::Graphics::bakeMeshMorph ( Mesh mesh)
pure virtual

If mesh morph weights are dirty, bake blended positions and upload to the GPU VBO. Returns true when an upload happened. No-op when no morph data / not dirty / null.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ begin3DFrame()

virtual void eve::graphics::Graphics::begin3DFrame ( )
pure virtual

Begin a 3D frame: shadow/gbuffer (if pending) then a sampleable scene color pass (color+depth). Leaves the pass open for drawMesh and a following RenderSystem::render (2D). Does not present. flushToSwapchain resolves the scene color (FXAA when "aa" is on) into the swapchain, then draws 2D overlays. Soft-fails (no throw) when the swapchain cannot be acquired yet — check had3DThisFrame().

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ begin3DFrameToCanvas()

virtual void eve::graphics::Graphics::begin3DFrameToCanvas ( Canvas canvas)
pure virtual

Open a 3D render pass targeting an offscreen Canvas (color + depth) at the canvas size. Uses setMesh3DViewProj/View/CameraPos/Env as the camera. Draw meshes with drawMeshShader, then call end3DFrameToCanvas(). The canvas texture then holds the rendered scene (e.g. a planar reflection). Unsupported if canvas is not an offscreen canvas (screen).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::renderToCanvas().

◆ beginGBufferPass()

virtual void eve::graphics::Graphics::beginGBufferPass ( int  width,
int  height 
)
pure virtual

Depth/normal(/albedo) fill pass for mid/post effects. One-shot submit (like shadow); call before begin3DFrame when enabled. After endGBufferPass, textures are available via getRenderControl()->getGBuffer().

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ beginShadowPass()

virtual void eve::graphics::Graphics::beginShadowPass ( int  cascadeIndex)
pure virtual

Depth-only shadow pass for one cascade layer (0..2). Draws are recorded into the next begin3DFrame command buffer (ping-pong map per frame slot). Call before begin3DFrame.

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ circle() [1/2]

void eve::graphics::Graphics::circle ( std::string  mode,
float  x,
float  y,
float  radius 
)

◆ circle() [2/2]

void eve::graphics::Graphics::circle ( std::string  mode,
float  x,
float  y,
float  radius,
int  points 
)

Draws a circle using the specified arguments.

参数
modeThe mode of drawing (line/filled).
xX-coordinate.
yY-coordinate.
radiusRadius of the circle.
pointsNumber of points to use to draw the circle.

◆ clearPresentOverlay()

void eve::graphics::Graphics::clearPresentOverlay ( )
inline

Drop the present overlay callback (window gone; re-register on UI init).

在文件 Graphics.h653 行定义.

引用了 presentOverlayFn_ , 以及 presentOverlayUser_.

被这些函数引用 onNativeWindowDestroyed() , 以及 eve::graphics::vulkan::Graphics::onNativeWindowDestroyed().

◆ clearScreen()

void eve::graphics::Graphics::clearScreen ( )
virtual

Script-friendly wrappers (r,g,b[,a] floats — no Color type in Squirrel).

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp865 行定义.

引用了 eve::graphics::Canvas::clear().

◆ consumeFrameHad3D()

bool eve::graphics::Graphics::consumeFrameHad3D ( )
inline

True after begin3DFrame until present completes.

在文件 Graphics.h578 行定义.

引用了 frameHad3D , 以及 v.

◆ draw()

void eve::graphics::Graphics::draw ( Drawable drawable,
const glm::mat4 &  m 
)
virtual

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp848 行定义.

引用了 eve::graphics::Drawable::draw() , 以及 m.

◆ drawCanvas()

void eve::graphics::Graphics::drawCanvas ( Canvas canvas,
float  x,
float  y,
float  w,
float  h 
)
inline

在文件 Graphics.h355 行定义.

引用了 drawCanvasRGBA(), h, w, x , 以及 y.

◆ drawCanvasRGBA()

void eve::graphics::Graphics::drawCanvasRGBA ( Canvas canvas,
float  x,
float  y,
float  w,
float  h,
float  r = 1.f,
float  g = 1.f,
float  b = 1.f,
float  a = 1.f 
)
virtual

Draw a Canvas color buffer as a textured rect (same batch order as other 2D).

实现了 eve::graphics::IGraphics3D.

在文件 Graphics.cpp160 行定义.

引用了 a, b, drawTexturedRect(), eve::graphics::Canvas::getTexture(), h, w, x , 以及 y.

被这些函数引用 drawCanvas().

◆ drawMesh()

virtual void eve::graphics::Graphics::drawMesh ( Mesh mesh,
const glm::mat4 &  model,
Texture texture,
const Color tint 
)
pure virtual

Draw one mesh with model matrix. Requires begin3DFrame() (or an open swapchain pass).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ drawMeshGBuffer()

virtual void eve::graphics::Graphics::drawMeshGBuffer ( Mesh mesh,
const glm::mat4 &  mvp,
const glm::mat4 &  model,
float  nearZ,
float  farZ,
Texture albedo = nullptr,
float  tintR = 1.f,
float  tintG = 1.f,
float  tintB = 1.f 
)
pure virtual

◆ drawMeshGBufferAlpha()

virtual void eve::graphics::Graphics::drawMeshGBufferAlpha ( Mesh mesh,
const glm::mat4 &  mvp,
const glm::mat4 &  model,
float  nearZ,
float  farZ,
Texture albedo = nullptr,
float  tintR = 1.f,
float  tintG = 1.f,
float  tintB = 1.f 
)
pure virtual

GBuffer fill with alpha-cutout discard (card/billboard geometry such as sprite-stack slices): same outputs as drawMeshGBuffer, but transparent texels are discarded so depth/normal follow the silhouette. No-op on backends without the alpha pipeline (WebGPU).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ drawMeshShader()

virtual void eve::graphics::Graphics::drawMeshShader ( Mesh mesh,
const glm::mat4 &  model,
Texture texture,
const Color tint,
Shader shader 
)
pure virtual

◆ drawMeshShadow()

virtual void eve::graphics::Graphics::drawMeshShadow ( Mesh mesh,
const glm::mat4 &  lightMVP 
)
pure virtual

◆ drawMeshShadowAlpha()

virtual void eve::graphics::Graphics::drawMeshShadowAlpha ( Mesh mesh,
const glm::mat4 &  lightMVP,
Texture albedo = nullptr 
)
pure virtual

Shadow pass draw with alpha-cutout discard (card/billboard geometry such as sprite-stack slices): transparent texels of albedo are discarded so the slice casts a silhouette shadow instead of a solid quad. Requires an active shadow pass (beginShadowPass). No-op on backends without the alpha shadow pipeline (WebGPU).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ drawOcclusion()

void eve::graphics::Graphics::drawOcclusion ( Drawable drawable,
const glm::mat4 &  m 
)
virtual

Volumetric occlusion helpers (shadow-pass analogue for light shafts). drawOcclusion skips drawables with castOcclusion=false.

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp852 行定义.

引用了 eve::graphics::Drawable::drawOcclusion(), eve::graphics::Drawable::getCastOcclusion() , 以及 m.

被这些函数引用 eve::graphics::Volumetric::drawOccluder().

◆ drawOcclusionSolid()

void eve::graphics::Graphics::drawOcclusionSolid ( float  x,
float  y,
float  w,
float  h 
)
virtual

◆ drawOcclusionTexture()

void eve::graphics::Graphics::drawOcclusionTexture ( Texture texture,
float  x,
float  y,
float  w,
float  h 
)
virtual

◆ drawScene3D()

void eve::graphics::Graphics::drawScene3D ( float  x,
float  y,
float  w,
float  h 
)
inline

Script-friendly 4-arg form (simplesquirrel does not apply C++ defaults).

在文件 Graphics.h348 行定义.

引用了 drawScene3DRGBA(), h, w, x , 以及 y.

◆ drawScene3DRGBA()

void eve::graphics::Graphics::drawScene3DRGBA ( float  x,
float  y,
float  w,
float  h,
float  r = 1.f,
float  g = 1.f,
float  b = 1.f,
float  a = 1.f 
)
virtual

Composite this frame's 3D scene color into a rect (screen or active Canvas). virtual * Call after render3D(); order vs drawSolidRect / drawTexturedRect is preserved. If never called, present() still blits the 3D scene fullscreen under 2D. RGB is blitted opaque (scene A is linear depth, not transparency).

实现了 eve::graphics::IGraphics3D.

在文件 Graphics.cpp147 行定义.

引用了 a, b, drawTexturedRect(), drawTexturedRectShader(), getSceneColorTexture(), h, prepareSceneColorResolveShader(), w, x , 以及 y.

被这些函数引用 drawScene3D().

◆ drawSolidRect()

◆ drawSolidRectRGBA()

void eve::graphics::Graphics::drawSolidRectRGBA ( float  x,
float  y,
float  w,
float  h,
float  r,
float  g,
float  b,
float  a = 1.f 
)
virtual

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp869 行定义.

引用了 a, b, drawSolidRect(), h, w, x , 以及 y.

◆ drawSolidRectRotated()

virtual void eve::graphics::Graphics::drawSolidRectRotated ( float  cx,
float  cy,
float  w,
float  h,
float  degrees,
const Color color,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

Rotated solid quad degrees clockwise (screen Y-down) around (cx, cy).

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem::drawItems().

◆ drawTexturedRect()

virtual void eve::graphics::Graphics::drawTexturedRect ( Texture texture,
float  x,
float  y,
float  w,
float  h,
const Color color 
)
pure virtual

Draw a textured quad (full UV 0..1). texture may be null → solid. Uses currentShader when set (or per-call override via drawTexturedRectShader).

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::stylize::StyleChain::apply(), drawCanvasRGBA(), drawOcclusionTexture(), drawScene3DRGBA() , 以及 drawTexturedRectRGBA().

◆ drawTexturedRectLitUV()

virtual void eve::graphics::Graphics::drawTexturedRectLitUV ( Texture albedo,
Texture normal,
float  x,
float  y,
float  w,
float  h,
float  u0,
float  v0,
float  u1,
float  v1,
const Color color 
)
pure virtual

Lit 2D draw (albedo + normal map). Uses Lighting2DUBO from setLighting2D. normal may be null → treated as flat (0.5,0.5,1) only if a default normal tex exists.

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem::drawItems().

◆ drawTexturedRectRGBA()

void eve::graphics::Graphics::drawTexturedRectRGBA ( Texture texture,
float  x,
float  y,
float  w,
float  h,
float  r,
float  g,
float  b,
float  a = 1.f 
)
virtual

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp873 行定义.

引用了 a, b, drawTexturedRect(), h, w, x , 以及 y.

◆ drawTexturedRectShader()

virtual void eve::graphics::Graphics::drawTexturedRectShader ( Texture texture,
Shader shader,
float  x,
float  y,
float  w,
float  h,
const Color color 
)
pure virtual

Draw with an explicit Shader (nullptr = default textured pipeline).

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::stylize::StylePass::apply(), drawScene3DRGBA() , 以及 eve::graphics::vulkan::Graphics::drawTexturedRectShaderDepth().

◆ drawTexturedRectShaderDepth()

virtual void eve::graphics::Graphics::drawTexturedRectShaderDepth ( Texture color,
Texture depth,
Shader shader,
float  x,
float  y,
float  w,
float  h,
const Color tint 
)
pure virtual

Fullscreen/post draw sampling color at binding 0 and depth at binding 1 (hardware D32, .r = Vulkan NDC z). depth may be null → color is bound twice.

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::Outline::apply(), eve::graphics::AmbientOcclusion::applyFromGBuffer() , 以及 eve::graphics::ScreenSpaceReflection::applyFromScene().

◆ drawTexturedRectShaderUV()

virtual void eve::graphics::Graphics::drawTexturedRectShaderUV ( Texture texture,
Shader shader,
float  x,
float  y,
float  w,
float  h,
float  u0,
float  v0,
float  u1,
float  v1,
const Color color,
bool  rotatedUV = false,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

◆ drawTexturedRectShaderUVRotated()

virtual void eve::graphics::Graphics::drawTexturedRectShaderUVRotated ( Texture texture,
Shader shader,
float  cx,
float  cy,
float  w,
float  h,
float  degrees,
float  u0,
float  v0,
float  u1,
float  v1,
const Color color,
bool  rotatedUV = false,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

UV draw rotated degrees clockwise (screen Y-down) around the rect center. texture may be null → solid. Shader nullptr = default textured pipeline.

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem::drawItems().

◆ drawTexturedRectUV()

virtual void eve::graphics::Graphics::drawTexturedRectUV ( Texture texture,
float  x,
float  y,
float  w,
float  h,
float  u0,
float  v0,
float  u1,
float  v1,
const Color color 
)
pure virtual

Draw a textured sub-rect (atlas / tile UVs). texture may be null → solid.

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::vulkan::Graphics::drawTexturedRect() , 以及 print().

◆ drawVoxelFaceInstances()

virtual void eve::graphics::Graphics::drawVoxelFaceInstances ( const uint32_t *  packed,
int  count,
float  originX,
float  originY,
float  originZ,
const std::string &  faceDir,
Texture atlas,
int  tilesPerRow = 16,
const uint32_t *  ao = nullptr 
)
pure virtual

Instanced voxel face rectangles (32-bit packed instances). ao: optional per-instance ambient-occlusion words (2 bits per corner, 0..3, shader corner order); null → full bright. faceDir: "posX"|"negX"|"posY"|"negY"|"posZ"|"negZ" (also "+x"/"-x"/…). Requires begin3DFrame(); uses viewProj from setMesh3DViewProj. atlas may be null → white; tilesPerRow subdivides atlas for texture indices.

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ ellipse() [1/2]

void eve::graphics::Graphics::ellipse ( std::string  mode,
float  x,
float  y,
float  a,
float  b 
)

◆ ellipse() [2/2]

void eve::graphics::Graphics::ellipse ( std::string  mode,
float  x,
float  y,
float  a,
float  b,
int  points 
)

Draws an ellipse using the specified arguments.

参数
modeThe mode of drawing (line/filled).
xX-coordinate of center
yY-coordinate of center
aRadius in x-direction
bRadius in y-direction
pointsNumber of points to use to draw the circle.

◆ end3DFrameToCanvas()

virtual void eve::graphics::Graphics::end3DFrameToCanvas ( )
pure virtual

◆ endGBufferPass()

virtual void eve::graphics::Graphics::endGBufferPass ( )
pure virtual

◆ endShadowPass()

virtual void eve::graphics::Graphics::endShadowPass ( )
pure virtual

◆ getBackendName()

virtual std::string eve::graphics::Graphics::getBackendName ( ) const
pure virtual

Renderer backend id used by sibling modules (e.g. Gpgpu).

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::stylize::createMeshShader().

◆ getBackgroundColor()

Color eve::graphics::Graphics::getBackgroundColor ( ) const
inline

在文件 Graphics.h584 行定义.

引用了 backgroundColor.

被这些函数引用 eve::graphics::RenderSystem::drawItems().

◆ getCanvas()

◆ getCurrentDPIScale()

double eve::graphics::Graphics::getCurrentDPIScale ( ) const
inline

在文件 Graphics.h122 行定义.

引用了 pixelWidth , 以及 width.

被这些函数引用 getScreenDPIScale().

◆ getFont()

Font * eve::graphics::Graphics::getFont ( ) const
inlinevirtual

◆ getHeight()

◆ getMaxAnisotropy()

virtual float eve::graphics::Graphics::getMaxAnisotropy ( ) const
pure virtual

Device max supported anisotropy (1 if unsupported). Valid after initWithWindow.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ getMsaaSamples()

virtual int eve::graphics::Graphics::getMsaaSamples ( ) const
inlinevirtual

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.

在文件 Graphics.h613 行定义.

引用了 msaaSamples.

◆ getPixelHeight()

int eve::graphics::Graphics::getPixelHeight ( ) const
inline

在文件 Graphics.h120 行定义.

引用了 pixelHeight.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getPixelWidth()

int eve::graphics::Graphics::getPixelWidth ( ) const
inline

在文件 Graphics.h119 行定义.

引用了 pixelWidth.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getPresentOverlay()

PresentOverlayFn eve::graphics::Graphics::getPresentOverlay ( ) const
inline

在文件 Graphics.h677 行定义.

引用了 presentOverlayFn_.

◆ getPresentOverlayUser()

void * eve::graphics::Graphics::getPresentOverlayUser ( ) const
inline

在文件 Graphics.h678 行定义.

引用了 presentOverlayUser_.

被这些函数引用 eve::ui::ImGuiBackend::shutdown().

◆ getProjection()

const glm::mat4 & eve::graphics::Graphics::getProjection ( ) const

◆ getRenderControl()

RenderControl * eve::graphics::Graphics::getRenderControl ( )

Shared compilable 3D render control (features → pass list + GBuffer). Owned by Graphics; valid for the module lifetime.

在文件 Graphics.cpp173 行定义.

引用了 renderControl_.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getSceneColorTexture()

virtual Texture * eve::graphics::Graphics::getSceneColorTexture ( )
inlinevirtual

Sampleable 3D color target for the current frame (RGB = lit, A = linear depth). Valid after begin3DFrame until present; nullptr when 3D did not run offscreen.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.

在文件 Graphics.h432 行定义.

被这些函数引用 drawScene3DRGBA().

◆ getScreenDPIScale()

double eve::graphics::Graphics::getScreenDPIScale ( ) const
inline

在文件 Graphics.h125 行定义.

引用了 getCurrentDPIScale().

◆ getShader()

Shader * eve::graphics::Graphics::getShader ( ) const
inlinevirtual

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.h703 行定义.

引用了 currentShader.

◆ getTransform()

const glm::mat4 & eve::graphics::Graphics::getTransform ( ) const

◆ getWidth()

◆ had3DThisFrame()

bool eve::graphics::Graphics::had3DThisFrame ( ) const
inline

在文件 Graphics.h582 行定义.

引用了 frameHad3D.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ initWithWindow()

virtual void eve::graphics::Graphics::initWithWindow ( void *  nativeWindow)
pure virtual

Bind to an existing native window (SDL_Window*) and create Vulkan device/swapchain. Must be called after the window exists (SDL_WINDOW_VULKAN).

实现了 eve::IWindowSurfaceHost.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ inverseTransformPoint()

glm::vec2 eve::graphics::Graphics::inverseTransformPoint ( glm::vec2  point)

◆ isActive()

bool eve::graphics::Graphics::isActive ( ) const
inline

在文件 Graphics.h621 行定义.

引用了 graphicsActive.

被这些函数引用 eve::graphics::vulkan::Graphics::present().

◆ isCanvasActive()

virtual bool eve::graphics::Graphics::isCanvasActive ( ) const
pure virtual

◆ isScreenReadbackEnabled()

bool eve::graphics::Graphics::isScreenReadbackEnabled ( ) const
inline

在文件 Graphics.h592 行定义.

引用了 screenReadbackEnabled.

◆ isVSync()

bool eve::graphics::Graphics::isVSync ( ) const
inline

在文件 Graphics.h605 行定义.

引用了 vsyncEnabled.

◆ markSwapchainDirty()

virtual void eve::graphics::Graphics::markSwapchainDirty ( )
inlinevirtual

Request swapchain recreation on next present/begin3DFrame.

在文件 Graphics.h624 行定义.

被这些函数引用 setActive().

◆ Module_REG()

eve::graphics::Graphics::Module_REG ( Graphics  )

◆ newAmbientOcclusion()

AmbientOcclusion * eve::graphics::Graphics::newAmbientOcclusion ( )
virtual

Screen-space ambient occlusion (ssao / hbao / gtao). Caller owns AmbientOcclusion*; its Shaders are owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp751 行定义.

◆ newAntiAliasing()

AntiAliasing * eve::graphics::Graphics::newAntiAliasing ( )
virtual

Classic image-space AA (FXAA / SMAA / SSAA / NFAA). Caller owns AntiAliasing*; its Shaders are owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp779 行定义.

◆ newCanvas()

virtual Canvas * eve::graphics::Graphics::newCanvas ( int  width,
int  height 
)
pure virtual

Create an offscreen render target (sampleable). Owned by Graphics.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::ScreenSpaceReflection::getReflectionCanvas().

◆ newCubemap() [1/2]

virtual Texture * eve::graphics::Graphics::newCubemap ( int  faceSize,
const uint8_t *  rgbaFaces 
)
pure virtual

Create an RGBA8 cubemap from 6 faces packed as +X,-X,+Y,-Y,+Z,-Z (each faceSize×faceSize, total bytes = faceSize²×4×6). Owned by Graphics.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::vulkan::Graphics::newCubemap() , 以及 eve::daynight::DayNight::update().

◆ newCubemap() [2/2]

virtual Texture * eve::graphics::Graphics::newCubemap ( int  faceSize,
const uint8_t *  rgbaFaces,
const TextureCreateInfo info 
)
pure virtual

Cubemap with mipmap / sampler options (IBL-friendly when generateMipmaps=true).

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ newFont()

Font * eve::graphics::Graphics::newFont ( font::FontData data,
std::string  charset = Font::defaultCharset() 
)
virtual

Build a GPU font (glyph atlas texture) from decoded font data. Rasterizes charset (UTF-8, default: printable ASCII) up front; virtual * codepoints outside it still advance in print() but aren't drawn. Caller owns Font* (not tracked by Graphics — unlike newTexture / newMesh / newShader handles, which Graphics owns).

实现了 eve::graphics::IResourceFactory.

在文件 Graphics.cpp934 行定义.

引用了 data.

◆ newGlobalIllumination()

GlobalIllumination * eve::graphics::Graphics::newGlobalIllumination ( )
virtual

Screen-space single-bounce GI. Caller owns GlobalIllumination*; its Shaders are owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp755 行定义.

◆ newGrassField()

GrassField * eve::graphics::Graphics::newGrassField ( )
virtual

Dense + sparse stylized grass field. Caller owns GrassField*; its Mesh / Shader / Texture are owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp785 行定义.

◆ newGrassShader()

Shader * eve::graphics::Graphics::newGrassShader ( )
virtual

t3ssel8r-style grass billboard shader (alpha test + shadow two-tone). Owned by Graphics. See grass:: / GrassField.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp783 行定义.

引用了 eve::graphics::grass::createShader().

◆ newHairShader()

Shader * eve::graphics::Graphics::newHairShader ( )

Built-in hair shader with default anisotropic parameters.

在文件 Graphics.cpp781 行定义.

引用了 eve::graphics::hair::createShader().

◆ newHairShaderFromSpv()

virtual Shader * eve::graphics::Graphics::newHairShaderFromSpv ( const std::vector< uint32_t > &  vertSpv,
const std::vector< uint32_t > &  fragSpv 
)
pure virtual

Hair/fur card shader (alpha blend + Kajiya-Kay). Empty vert → mesh3d_hair.vert. Owned by Graphics.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::hair::createShader().

◆ newMaterial()

Material * eve::graphics::Graphics::newMaterial ( )

Create a Material asset (shading model + textures + PBR knobs). Caller owns Material*; not tracked by Graphics.

在文件 Graphics.cpp171 行定义.

被这些函数引用 eve::weather::Weather::init().

◆ newMeshCube()

Mesh * eve::graphics::Graphics::newMeshCube ( float  size = 1.f)
virtual

Procedural cube (edge length size, centered at origin, outward CCW for RH Y-up), with per-face normals and a full 0..1 UV per face. Owned by Graphics.

实现了 eve::graphics::IResourceFactory.

在文件 Graphics.cpp790 行定义.

引用了 c, f, h, newMeshFromArrays() , 以及 pos.

◆ newMeshCylinder()

virtual Mesh * eve::graphics::Graphics::newMeshCylinder ( int  slices = 32,
int  stacks = 1,
bool  caps = true 
)
pure virtual

Procedural Y-up cylinder (radius 1, height 2 centered at origin). slices = longitude divisions; stacks = height bands; caps = include end discs. Owned by Graphics.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ newMeshFromArrays()

virtual Mesh * eve::graphics::Graphics::newMeshFromArrays ( const float *  posXYZ,
const float *  nrmXYZ,
const float *  uvST,
int  vertexCount,
const uint32_t *  indices,
int  indexCount 
)
pure virtual

Upload a triangle mesh from packed CPU arrays. Owned by Graphics. posXYZ required (vertexCount*3). nrmXYZ/uvST may be null (flat normal / zero UV). indices required (indexCount, triangles).

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::GrassField::bake(), eve::graphics::Water::createPlane(), eve::graphics::Waterfall::createSheet(), eve::procgen::Procgen::generateMesh() , 以及 newMeshCube().

◆ newMeshFromAssimp() [1/2]

virtual Mesh * eve::graphics::Graphics::newMeshFromAssimp ( const ::aiMesh &  mesh)
pure virtual

Upload triangulated mesh from Assimp (pos/normal/uv + indices). Owned by Graphics. Also captures Assimp morph targets (aiAnimMesh) into Mesh CPU morph data when present.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::housegen::HouseLayout::instantiate().

◆ newMeshFromAssimp() [2/2]

virtual Mesh * eve::graphics::Graphics::newMeshFromAssimp ( const ::aiMesh &  mesh,
const aiMatrix4x4 &  worldTransform 
)
pure virtual

Like newMeshFromAssimp, but bakes an Assimp node world transform into positions and transforms normals by the inverse-transpose of the upper 3x3. Required for hierarchical glTF/FBX scenes — raw aiMesh verts are in local space.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ newMeshShader() [1/2]

Shader * eve::graphics::Graphics::newMeshShader ( const std::string &  fragGlsl)
inline

在文件 Graphics.h741 行定义.

引用了 newMeshShader().

◆ newMeshShader() [2/2]

virtual Shader * eve::graphics::Graphics::newMeshShader ( const std::string &  vertGlsl,
const std::string &  fragGlsl 
)
pure virtual

◆ newMeshShaderFromSpv()

virtual Shader * eve::graphics::Graphics::newMeshShaderFromSpv ( const std::vector< uint32_t > &  vertSpv,
const std::vector< uint32_t > &  fragSpv 
)
pure virtual

◆ newMeshShaderFromWgsl()

virtual Shader * eve::graphics::Graphics::newMeshShaderFromWgsl ( const std::string &  vertWgsl,
const std::string &  fragWgsl 
)
pure virtual

Create a Mesh3D custom shader from WGSL source (WebGPU backend). The WGSL must declare the engine's Frame UBO (group 0 binding 0) and the shared mesh3d bindings (albedo 1, normal 2, env 3, shadow UBO 4, shadow depth 5, height 6, main sampler 7, shadow compare sampler 8, scene depth 9). Vulkan throws (uses SPIR-V via newMeshShaderFromSpv).

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::stylize::createMeshShader().

◆ newMeshSphere()

virtual Mesh * eve::graphics::Graphics::newMeshSphere ( int  slices = 32,
int  stacks = 16 
)
pure virtual

Procedural UV sphere (radius 1, Y-up). Owned by Graphics. slices = longitude divisions, stacks = latitude divisions.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ newOutline()

Outline * eve::graphics::Graphics::newOutline ( )
virtual

Screen-space model outline (t3ssel8r-style) from GBuffer depth + normal. Caller owns Outline*; its Shader is owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp753 行定义.

◆ newQuad()

Quad * eve::graphics::Graphics::newQuad ( int  x,
int  y,
int  w,
int  h 
)

Pixel-space atlas rect. Caller owns Quad* (not tracked by Graphics).

在文件 Graphics.cpp931 行定义.

引用了 h, w, x , 以及 y.

◆ newScreenSpaceReflection()

ScreenSpaceReflection * eve::graphics::Graphics::newScreenSpaceReflection ( )
virtual

Screen-space reflections (ray-marched over scene color + hw depth). Caller owns ScreenSpaceReflection*; its Shader is owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp757 行定义.

◆ newShader() [1/2]

Shader * eve::graphics::Graphics::newShader ( const std::string &  fragGlsl)
inline

在文件 Graphics.h723 行定义.

引用了 newShader().

被这些函数引用 newShader().

◆ newShader() [2/2]

virtual Shader * eve::graphics::Graphics::newShader ( const std::string &  vertGlsl,
const std::string &  fragGlsl 
)
pure virtual

Compile GLSL source with glslc (must be on PATH). Empty vertGlsl → default textured vert. Throws if compilation fails.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ newShaderFromSpv()

virtual Shader * eve::graphics::Graphics::newShaderFromSpv ( const std::vector< uint32_t > &  vertSpv,
const std::vector< uint32_t > &  fragSpv 
)
pure virtual

Create a custom 2D shader from SPIR-V words (vert + frag). Owned by Graphics. Vertex stage may be empty → uses the default textured vertex shader.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::stylize::createPostShader(), eve::graphics::vulkan::Graphics::newShader() , 以及 eve::graphics::vulkan::Graphics::newShaderFromSpvFile().

◆ newShaderFromSpvFile() [1/2]

Shader * eve::graphics::Graphics::newShaderFromSpvFile ( const std::string &  fragPath)
inline

在文件 Graphics.h714 行定义.

引用了 newShaderFromSpvFile().

◆ newShaderFromSpvFile() [2/2]

virtual Shader * eve::graphics::Graphics::newShaderFromSpvFile ( const std::string &  vertPath,
const std::string &  fragPath 
)
pure virtual

Load SPIR-V from files via Filesystem (empty vertPath → default textured vert).

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 newShaderFromSpvFile().

◆ newTexture() [1/4]

virtual Texture * eve::graphics::Graphics::newTexture ( image::ImageData data)
pure virtual

Create texture from ImageData (RGBA8 required for now).

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ newTexture() [2/4]

virtual Texture * eve::graphics::Graphics::newTexture ( image::ImageData data,
const TextureCreateInfo info 
)
pure virtual

Create texture from ImageData with sampler / mipmap options.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ newTexture() [3/4]

◆ newTexture() [4/4]

virtual Texture * eve::graphics::Graphics::newTexture ( int  width,
int  height,
const uint8_t *  rgba,
const TextureCreateInfo info 
)
pure virtual

Create RGBA8 texture with explicit sampler / mipmap options. Borrowed handle: Graphics owns the texture (freed at shutdown or via releaseTexture); callers must not delete it.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ newTextureFromFile()

virtual Texture * eve::graphics::Graphics::newTextureFromFile ( const std::string &  filename)
pure virtual

Load file via Filesystem + Image decode, then upload (RGBA8). Throws on failure. Same path returns the same Texture* and reloads pixels in place on repeat calls.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::spritestack::SpriteStack3D::setLayerFile().

◆ newTextureFromFileRepeated()

Texture * eve::graphics::Graphics::newTextureFromFileRepeated ( const std::string &  filename,
bool  repeatU,
bool  repeatV 
)
virtual

Load a texture from disk with wrap/repeat sampling (for tiling structures). Non-virtual helper (same pattern as newTextureFromImageData); reads + decodes via Filesystem/Image then uploads with the requested repeat modes.

实现了 eve::graphics::IResourceFactory.

在文件 Graphics.cpp893 行定义.

引用了 data, newTextureFromImageData(), repeatU , 以及 repeatV.

◆ newTextureFromImageData() [1/2]

Texture * eve::graphics::Graphics::newTextureFromImageData ( image::ImageData data,
bool  repeatU = false,
bool  repeatV = false 
)
virtual

Upload RGBA8 ImageData; optional seamless repeat on U/V. Borrowed handle: Graphics owns the texture (freed at shutdown or via releaseTexture); callers must not delete it.

实现了 eve::graphics::IResourceFactory.

在文件 Graphics.cpp878 行定义.

引用了 data, newTexture(), eve::graphics::TextureSampler::repeatU, repeatU, eve::graphics::TextureSampler::repeatV, repeatV , 以及 eve::graphics::TextureCreateInfo::sampler.

被这些函数引用 newTextureFromFileRepeated(), newTextureWithSampler() , 以及 eve::spritestack::SpriteStack3D::setLayerImage().

◆ newTextureFromImageData() [2/2]

Texture * eve::graphics::Graphics::newTextureFromImageData ( image::ImageData data,
const TextureCreateInfo info 
)
virtual

Upload RGBA8 ImageData with mipmaps / filter / anisotropy options.

实现了 eve::graphics::IResourceFactory.

在文件 Graphics.cpp887 行定义.

引用了 data , 以及 newTexture().

◆ newTextureWithSampler()

Texture * eve::graphics::Graphics::newTextureWithSampler ( image::ImageData data,
bool  repeatU,
bool  repeatV,
bool  generateMipmaps,
float  maxAnisotropy,
const std::string &  filter,
const std::string &  mipmap,
float  lodBias = 0.f 
)
virtual

◆ newVolumetric()

Volumetric * eve::graphics::Graphics::newVolumetric ( )
virtual

Volumetric light + fog (screenspace / raymarch / fog). Caller owns Volumetric*; its Shaders are owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp749 行定义.

◆ newWater()

Water * eve::graphics::Graphics::newWater ( )
virtual

Dynamic water surface (sky reflection + animated edge waves + middle drop ripples). Caller owns Water*; its Mesh / Shader are owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp788 行定义.

◆ newWaterfall()

Waterfall * eve::graphics::Graphics::newWaterfall ( )
virtual

Flowing waterfall (falling water sheet) with sky reflection, downward velocity streaks and animated foam at the top lip and bottom splash pool. Caller owns Waterfall*; its Mesh / Shader are owned by Graphics.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp787 行定义.

◆ onNativeWindowDestroyed()

virtual void eve::graphics::Graphics::onNativeWindowDestroyed ( )
inlinevirtual

Called by the Window module when the native window backing the render surface is destroyed (window close / recreation). Backends that keep a platform surface tied to the native window must drop it here so the next initWithWindow() rebuilds it against a fresh window — even when SDL hands back the same pointer for the recreated window.

The present overlay is bound to the destroyed window, so it is also dropped here: a stale ImGui callback would otherwise keep drawing into later presents of unrelated windows. Registered window-destroyed callbacks (e.g. the UI backend's ImGui teardown) fire first so they can release their ImGui context while the surface is still valid.

实现了 eve::IWindowSurfaceHost.

eve::graphics::vulkan::Graphics 重载.

在文件 Graphics.h646 行定义.

引用了 clearPresentOverlay() , 以及 windowDestroyedCallbacks_.

◆ origin()

void eve::graphics::Graphics::origin ( )

◆ pipelineAmbientOcclusion()

AmbientOcclusion * eve::graphics::Graphics::pipelineAmbientOcclusion ( )
virtual

Pipeline-owned AO / GI / AA used by RenderSystem3D when features "ao" / "gi" / "aa" are enabled. Created on first use; Graphics owns them.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp759 行定义.

引用了 pipelineAO_.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ pipelineAntiAliasing()

AntiAliasing * eve::graphics::Graphics::pipelineAntiAliasing ( )
virtual

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp769 行定义.

引用了 pipelineAA_.

被这些函数引用 prepareSceneColorResolveShader().

◆ pipelineGlobalIllumination()

GlobalIllumination * eve::graphics::Graphics::pipelineGlobalIllumination ( )
virtual

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp764 行定义.

引用了 pipelineGI_.

◆ pipelineOutline()

Outline * eve::graphics::Graphics::pipelineOutline ( )
virtual

Pipeline-owned Outline used by RenderSystem3D when the "outline" feature is on.

实现了 eve::graphics::IPostFX.

在文件 Graphics.cpp774 行定义.

引用了 pipelineOutline_.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ points()

void eve::graphics::Graphics::points ( const std::vector< glm::vec2 > &  positions,
const std::vector< Color > &  colors 
)

Draws a series of points at the specified positions.

◆ polygon()

void eve::graphics::Graphics::polygon ( std::string  mode,
const std::vector< glm::vec2 > &  vertices,
bool  skipLastFilledVertex = true 
)

Draws a polygon with an arbitrary number of vertices.

参数
modeThe type of drawing (line/filled).
coordsVertex positions.
countVertex array size.

◆ polyline()

void eve::graphics::Graphics::polyline ( const glm::mat4 *  vertices,
size_t  count 
)

Draws a series of lines connecting the given vertices.

参数
coordsVertex positions (v1, ..., vn). If v1 == vn the line will be drawn closed.
countNumber of vertices.

◆ pop()

void eve::graphics::Graphics::pop ( )

◆ popValidationScope()

virtual void eve::graphics::Graphics::popValidationScope ( )
pure virtual

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 render3D().

◆ prepareSceneColorResolveShader()

Shader * eve::graphics::Graphics::prepareSceneColorResolveShader ( Texture scene)
protected

◆ present()

virtual void eve::graphics::Graphics::present ( )
pure virtual

◆ print()

void eve::graphics::Graphics::print ( const std::string &  text,
float  x,
float  y,
const Color color = Color(1.f, 1.f, 1.f, 1.f),
float  scale = 1.f 
)
virtual

Draws UTF-8 text with the current font (see setFont), baseline-aligned so that (x,y) is the top-left of the line. Throws if no font is set.

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp936 行定义.

引用了 color, currentFont, data, drawTexturedRectUV(), eve::graphics::Font::findGlyph(), eve::graphics::Font::getBaseline(), eve::graphics::Font::getData(), eve::graphics::Font::getTexture(), eve::graphics::nextCodepointUtf8(), eve::debug::rtBind(), eve::debug::rtDraw(), scale, x , 以及 y.

被这些函数引用 eve::card::printCentered().

◆ push()

void eve::graphics::Graphics::push ( bool  all)

◆ pushValidationScope()

virtual void eve::graphics::Graphics::pushValidationScope ( )
pure virtual

Backend hooks so the platform-independent render3D() can wrap its work in a GPU validation error scope (used on WebGPU to catch early device errors).

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 render3D().

◆ readGBufferToImageData()

virtual image::ImageData * eve::graphics::Graphics::readGBufferToImageData ( const std::string &  name)
inlinevirtual

Read a G-buffer attachment back to CPU as RGBA8. name is one of "depth" (RGBA8 linear depth), "normal" (world normal*0.5+0.5), "albedo". Valid only after a G-buffer or entity-ID offscreen pass filled it. Caller owns the returned ImageData*. Returns nullptr when unsupported.

eve::graphics::vulkan::Graphics 重载.

在文件 Graphics.h461 行定义.

引用了 name.

◆ rectangle() [1/3]

void eve::graphics::Graphics::rectangle ( std::string  mode,
float  x,
float  y,
float  w,
float  h 
)

Draws a rectangle.

参数
xPosition along x-axis for top-left corner.
yPosition along y-axis for top-left corner.
wThe width of the rectangle.
hThe height of the rectangle.

◆ rectangle() [2/3]

void eve::graphics::Graphics::rectangle ( std::string  mode,
float  x,
float  y,
float  w,
float  h,
float  rx,
float  ry 
)

◆ rectangle() [3/3]

void eve::graphics::Graphics::rectangle ( std::string  mode,
float  x,
float  y,
float  w,
float  h,
float  rx,
float  ry,
int  points 
)

Variant of rectangle that draws a rounded rectangle.

参数
modeThe mode of drawing (line/filled).
xX-coordinate of top-left corner
yY-coordinate of top-left corner
wThe width of the rectangle.
hThe height of the rectangle.
rxThe radius of the corners on the x axis
ryThe radius of the corners on the y axis
pointsThe number of points to use per corner

◆ releaseMesh()

virtual bool eve::graphics::Graphics::releaseMesh ( Mesh mesh)
inlinevirtual

Eagerly releases a mesh created by this Graphics.

Mirrors releaseTexture: the returned handle is borrowed, a successful release frees the GPU buffers, detaches the handle (gpuHandle becomes null) and transfers the CPU facade to the caller for deletion.

参数
meshHandle returned by a previous create call (may be null).
返回
true when released; false for null, foreign or already-released handles.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.

在文件 Graphics.h324 行定义.

引用了 mesh.

◆ releaseShader()

virtual bool eve::graphics::Graphics::releaseShader ( Shader shader)
inlinevirtual

Eagerly releases a shader created by this Graphics.

Mirrors releaseTexture: the returned handle is borrowed, a successful release destroys the GPU pipelines, detaches the handle (gpuHandle becomes null) and transfers the CPU facade to the caller for deletion. Only call this on shaders you created yourself; shaders owned by Graphics pipeline objects (AA / AO / GI / grass / ...) are still reachable through their owning objects and must not be released.

参数
shaderHandle returned by a previous create call (may be null).
返回
true when released; false for null, foreign or already-released handles.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.

在文件 Graphics.h768 行定义.

引用了 shader.

◆ releaseTexture()

virtual bool eve::graphics::Graphics::releaseTexture ( Texture texture)
inlinevirtual

Eagerly releases a texture created by this Graphics.

All newTexture* / newCubemap results are borrowed handles: the Graphics backend owns both the CPU facade and the GPU resource, and the handle must not be deleted directly. A successful release frees the GPU resource (after in-flight frames drain), detaches the handle (gpuHandle becomes null) and transfers the CPU facade to the caller, who may then delete it. Renderer-owned fallback textures (white / flat-normal / environment) and resources created by another Graphics are never released here.

参数
textureHandle returned by a previous create call (may be null).
返回
true when released; false for null, foreign, internal or already-released handles.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.

在文件 Graphics.h200 行定义.

◆ reloadTextureFromFile()

virtual bool eve::graphics::Graphics::reloadTextureFromFile ( const std::string &  filename)
pure virtual

Reload a path-cached texture from disk in place (pointer stable). False if unbound.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ render3D()

void eve::graphics::Graphics::render3D ( )
virtual

◆ renderEntityIdMask()

virtual image::ImageData * eve::graphics::Graphics::renderEntityIdMask ( const std::vector< EntityIdDraw > &  draws,
const glm::mat4 &  viewProj,
int  width,
int  height 
)
inlinevirtual

在文件 Graphics.h446 行定义.

引用了 height, viewProj , 以及 width.

◆ renderScene3DToCanvas()

void eve::graphics::Graphics::renderScene3DToCanvas ( Canvas canvas,
Camera3D camera 
)
virtual

Preview-quality 3D pass into an offscreen Canvas (editor viewport): renders visible Renderable3D with camera into canvas, whose texture can then be shown inside a UI Viewport widget. See RenderSystem3D::renderToCanvas.

实现了 eve::graphics::IGraphics3D.

在文件 Graphics.cpp127 行定义.

引用了 eve::graphics::RenderSystem3D::renderToCanvas().

◆ requestSurfaceRecreate()

void eve::graphics::Graphics::requestSurfaceRecreate ( )
inlineoverridevirtual

Request recreation of the platform render surface on the next frame (Android background/foreground destroys the native window). Safe to call from a non-render thread; the actual work happens on the render thread.

实现了 eve::IWindowSurfaceHost.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.

在文件 Graphics.h631 行定义.

◆ reset()

void eve::graphics::Graphics::reset ( )
virtual

Resets the current color, background color, line style, and so forth.

在文件 Graphics.cpp740 行定义.

引用了 currentFont , 以及 currentShader.

◆ rotate()

void eve::graphics::Graphics::rotate ( float  r)

◆ saveFramePng()

bool eve::graphics::Graphics::saveFramePng ( const std::string &  path)

Save the last presented frame to a PNG at path. Enables screen readback if needed. Returns false if no presented frame is available or encoding fails.

在文件 Graphics.cpp828 行定义.

引用了 eve::graphics::Canvas::newImageData(), screenReadbackEnabled , 以及 setScreenReadbackEnabled().

◆ scale()

void eve::graphics::Graphics::scale ( float  x,
float  y = 1.0f 
)

◆ setActive()

void eve::graphics::Graphics::setActive ( bool  active)
inlineoverridevirtual

Pause/resume presenting (Android background / foreground).

实现了 eve::IWindowSurfaceHost.

在文件 Graphics.h616 行定义.

引用了 active, graphicsActive , 以及 markSwapchainDirty().

◆ setBackgroundColor()

void eve::graphics::Graphics::setBackgroundColor ( const Color c)
inline

在文件 Graphics.h585 行定义.

引用了 backgroundColor , 以及 c.

被这些函数引用 setBackgroundColorRGBA().

◆ setBackgroundColorRGBA()

void eve::graphics::Graphics::setBackgroundColorRGBA ( float  r,
float  g,
float  b,
float  a = 1.f 
)
virtual

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp867 行定义.

引用了 a, b , 以及 setBackgroundColor().

被这些函数引用 eve::daynight::DayNight::update() , 以及 eve::weather::Weather::update().

◆ setCanvas() [1/2]

void eve::graphics::Graphics::setCanvas ( )
inline

在文件 Graphics.h803 行定义.

引用了 setCanvas().

被这些函数引用 setCanvas().

◆ setCanvas() [2/2]

◆ setCloudShadows()

virtual void eve::graphics::Graphics::setCloudShadows ( float  strength,
float  worldCell,
float  time,
float  windSpeed,
float  windAngle,
float  coverage,
float  detail 
)
pure virtual

Dynamic cloud shadows cast on the ground by the default PBR mesh path. strength 0 disables (no change to rendering). time advances wind drift. Packed into Mesh3DUBO.cloud / cloudWind and consumed by mesh3d shaders.

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ setDirectionalLight()

void eve::graphics::Graphics::setDirectionalLight ( float  dx,
float  dy,
float  dz,
float  r = 1.f,
float  g = 1.f,
float  b = 1.f 
)
virtual

◆ setFont()

virtual void eve::graphics::Graphics::setFont ( Font font)
inlinevirtual

Font used by subsequent print() calls; nullptr = none set.

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.h690 行定义.

引用了 currentFont.

◆ setLighting2D()

virtual void eve::graphics::Graphics::setLighting2D ( const Lighting2DUBO ubo)
pure virtual

Upload per-frame / per-canvas 2D lighting constants for subsequent lit draws.

实现了 eve::graphics::IGraphics2D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem::drawItems().

◆ setMesh3DCameraPos()

virtual void eve::graphics::Graphics::setMesh3DCameraPos ( const glm::vec3 &  eye)
pure virtual

◆ setMesh3DClip()

virtual void eve::graphics::Graphics::setMesh3DClip ( float  nearZ,
float  farZ 
)
pure virtual

◆ setMesh3DClusteredActive()

virtual void eve::graphics::Graphics::setMesh3DClusteredActive ( bool  active)
pure virtual

Cheap per-draw toggle for the already-uploaded clustered light table. Unlike setMesh3DClusteredLighting it never re-uploads SSBO data, so the per-frame clustered build happens exactly once per camera.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::Material::bind() , 以及 eve::graphics::RenderSystem3D::render().

◆ setMesh3DClusteredLighting()

virtual void eve::graphics::Graphics::setMesh3DClusteredLighting ( const ClusteredLightingUpload upload)
pure virtual

Enable clustered forward path for subsequent default mesh draws (SSBO light lists). Pass upload.active=false (or empty) to disable and return to the ≤8 UBO path.

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMesh3DEnv()

virtual void eve::graphics::Graphics::setMesh3DEnv ( Texture cube,
float  intensity 
)
pure virtual

Specular IBL environment for subsequent default mesh draws. cube must be from newCubemap (or nullptr → black / intensity 0). intensity is packed into Mesh3DUBO lightColor.w.

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::render(), eve::spritestack::SpriteStackBatch::render(), eve::spritestack::SpriteStack3D::render(), eve::graphics::RenderSystem3D::renderToCanvas() , 以及 eve::daynight::DayNight::update().

◆ setMesh3DHeightTexture()

virtual void eve::graphics::Graphics::setMesh3DHeightTexture ( Texture height)
pure virtual

Optional height map for parallax (R channel; nullptr = flat / off).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::Material::bind(), eve::graphics::RenderSystem3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMesh3DLight()

virtual void eve::graphics::Graphics::setMesh3DLight ( const glm::vec3 &  dir,
const glm::vec3 &  color 
)
pure virtual

Directional light for subsequent drawMesh calls (world-space direction toward surface).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ setMesh3DLighting()

virtual void eve::graphics::Graphics::setMesh3DLighting ( const Lighting3DPack pack)
pure virtual

◆ setMesh3DMaterial()

virtual void eve::graphics::Graphics::setMesh3DMaterial ( float  metallic,
float  roughness 
)
pure virtual

Metallic (0..1) and roughness (0..1) for the next default mesh draw.

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::Material::bind(), eve::graphics::RenderSystem3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMesh3DNormalTexture()

virtual void eve::graphics::Graphics::setMesh3DNormalTexture ( Texture normal)
pure virtual

Optional normal map for the next drawMesh / drawMeshShader (nullptr = flat).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::Material::bind(), eve::graphics::RenderSystem3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMesh3DParallax()

virtual void eve::graphics::Graphics::setMesh3DParallax ( float  scale,
float  minLayers = 8.f,
float  maxLayers = 32.f 
)
pure virtual

Parallax occlusion mapping for the next default mesh draw. scale: UV displacement strength (0=off). Typical 0.02..0.08. minLayers / maxLayers: adaptive POM ray-march steps (more when glancing).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::Material::bind(), eve::graphics::RenderSystem3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMesh3DSceneDepth()

virtual void eve::graphics::Graphics::setMesh3DSceneDepth ( Texture depth)
pure virtual

Optional scene hardware depth (G-buffer hwDepth, Vulkan NDC z) bound to mesh3d shader binding 7. X-ray mesh shaders sample it to discard visible (non-occluded) fragments. nullptr falls back to a placeholder.

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ setMesh3DShadowReceive()

virtual void eve::graphics::Graphics::setMesh3DShadowReceive ( bool  receive)
pure virtual

Per-draw: when false, shadow sampling is forced off for the next mesh draw.

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::Material::bind(), eve::graphics::RenderSystem3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMesh3DShadows()

virtual void eve::graphics::Graphics::setMesh3DShadows ( const ShadowUpload upload)
pure virtual

Upload CSM constants for subsequent default mesh draws (active=false disables).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMesh3DTexCellBomb()

virtual void eve::graphics::Graphics::setMesh3DTexCellBomb ( float  cellScale,
float  strength,
float  rotAmount = 1.f 
)
pure virtual

Texture cell bombing for the next default mesh draw (breaks tiling). cellScale: cells per UV unit (typical 2..16). strength: 0=off, 1=full. rotAmount: 0..1 per-cell rotation scale (default 1).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::Material::bind(), eve::graphics::RenderSystem3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMesh3DView()

virtual void eve::graphics::Graphics::setMesh3DView ( const glm::mat4 &  view)
pure virtual

◆ setMesh3DViewProj()

virtual void eve::graphics::Graphics::setMesh3DViewProj ( const glm::mat4 &  viewProj)
pure virtual

viewProj used by subsequent drawMesh (mvp = viewProj * model). Expect RH + ZO with Vulkan NDC Y (see perspectiveVulkanRH_ZO).

实现了 eve::graphics::IGraphics3D.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::graphics::RenderSystem3D::render(), eve::spritestack::SpriteStackBatch::render(), eve::spritestack::SpriteStack3D::render() , 以及 eve::graphics::RenderSystem3D::renderToCanvas().

◆ setMsaaSamples()

virtual void eve::graphics::Graphics::setMsaaSamples ( int  samples)
inlinevirtual

Hardware MSAA sample count for the 3D scene color pass (0 disables, then 2/4/8 are used when the device supports them). 0 or 1 mean no MSAA. Takes effect on the next begin3DFrame.

eve::graphics::vulkan::Graphics 重载.

在文件 Graphics.h612 行定义.

引用了 msaaSamples.

被这些函数引用 eve::graphics::vulkan::Graphics::setMsaaSamples().

◆ setPresentOverlay()

void eve::graphics::Graphics::setPresentOverlay ( PresentOverlayFn  fn,
void *  userdata 
)
inline

在文件 Graphics.h673 行定义.

引用了 fn, presentOverlayFn_ , 以及 presentOverlayUser_.

被这些函数引用 eve::ui::ImGuiBackend::init() , 以及 eve::ui::ImGuiBackend::shutdown().

◆ setScreenReadbackEnabled()

virtual void eve::graphics::Graphics::setScreenReadbackEnabled ( bool  enabled)
inlinevirtual

When true, each present copies the swapchain to a CPU buffer for getPixel/newImageData. Default false — full-frame readback is expensive; enable only for tests / tools.

eve::graphics::vulkan::Graphics 重载.

在文件 Graphics.h591 行定义.

引用了 enabled , 以及 screenReadbackEnabled.

被这些函数引用 saveFramePng() , 以及 eve::graphics::vulkan::Graphics::setScreenReadbackEnabled().

◆ setShader() [1/2]

void eve::graphics::Graphics::setShader ( )
virtual

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp747 行定义.

引用了 currentShader.

◆ setShader() [2/2]

void eve::graphics::Graphics::setShader ( Shader shader)
virtual

Custom fragment pipeline for subsequent textured 2D draws.

实现了 eve::graphics::IGraphics2D.

在文件 Graphics.cpp745 行定义.

引用了 currentShader , 以及 shader.

◆ setTextureSampler()

virtual void eve::graphics::Graphics::setTextureSampler ( Texture texture,
const TextureSampler sampler 
)
pure virtual

Recreate the sampler for an existing texture (keeps image / mip chain). No-op when texture is null or not owned by this Graphics.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 setTextureSamplerParams().

◆ setTextureSamplerParams()

void eve::graphics::Graphics::setTextureSamplerParams ( Texture texture,
const std::string &  filter,
const std::string &  mipmap,
float  maxAnisotropy,
float  lodBias 
)
virtual

Update sampler state without re-uploading pixels (filter / mip / aniso / LOD bias).

实现了 eve::graphics::IResourceFactory.

在文件 Graphics.cpp919 行定义.

引用了 filter, eve::graphics::Texture::getSampler(), eve::graphics::TextureSampler::min, mipmap, eve::graphics::TextureSampler::parseFilter(), eve::graphics::TextureSampler::parseMipmap(), s , 以及 setTextureSampler().

◆ setViewportSize()

virtual void eve::graphics::Graphics::setViewportSize ( int  width,
int  height,
int  pixelwidth,
int  pixelheight 
)
pure virtual

Sets the current graphics display viewport dimensions.

实现了 eve::IWindowSurfaceHost.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ setVSync()

virtual void eve::graphics::Graphics::setVSync ( bool  enabled)
inlinevirtual

Prefer uncapped present (IMMEDIATE/MAILBOX) when false, vsync (MAILBOX/FIFO) when true. Takes effect on the next swapchain recreate.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.

在文件 Graphics.h604 行定义.

引用了 enabled , 以及 vsyncEnabled.

被这些函数引用 eve::graphics::vulkan::Graphics::setVSync() , 以及 eve::graphics::webgpu::Graphics::setVSync().

◆ supportsGBufferPost()

virtual bool eve::graphics::Graphics::supportsGBufferPost ( ) const
inlinevirtual

Whether gbuffer-based post-process shaders (AO, GI) can be created on this backend. False on WebGPU, whose custom post shaders are WGSL-only (the built-in AO/GI use SPIR-V), so RenderSystem3D skips them there.

eve::graphics::webgpu::Graphics 重载.

在文件 Graphics.h104 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ transformPoint()

glm::vec2 eve::graphics::Graphics::transformPoint ( glm::vec2  point)

◆ translate()

void eve::graphics::Graphics::translate ( float  x,
float  y 
)

◆ updateMeshVertices()

virtual bool eve::graphics::Graphics::updateMeshVertices ( Mesh mesh,
const float *  posXYZ,
const float *  nrmXYZ,
const float *  uvST,
int  vertexCount,
const uint32_t *  indices,
int  indexCount 
)
pure virtual

In-place update of a mesh's vertex/index data (CPU -> host-visible VBO). Mirrors bakeMeshMorph: the update synchronizes with in-flight GPU work, so prefer rebuilding only when content actually changes. The mesh's buffer is reused while it fits (stable GPU handle) and reallocated when the new size grows. Returns false when unsupported (WebGPU backend). posXYZ/nrmXYZ follow newMeshFromArrays layout (uvST may be null); indices/indexCount may be null/0 to keep the mesh's existing indices.

实现了 eve::graphics::IResourceFactory.

eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

类成员变量说明

◆ backgroundColor

◆ currentFont

Font* eve::graphics::Graphics::currentFont = nullptr
protected

在文件 Graphics.h989 行定义.

被这些函数引用 getFont(), print(), reset() , 以及 setFont().

◆ currentShader

Shader* eve::graphics::Graphics::currentShader = nullptr
protected

◆ frameHad3D

◆ graphicsActive

bool eve::graphics::Graphics::graphicsActive = true
protected

在文件 Graphics.h983 行定义.

被这些函数引用 isActive() , 以及 setActive().

◆ height

◆ msaaSamples

◆ pipelineAA_

std::unique_ptr<AntiAliasing> eve::graphics::Graphics::pipelineAA_
protected

在文件 Graphics.h993 行定义.

被这些函数引用 pipelineAntiAliasing() , 以及 eve::graphics::vulkan::Graphics::~Graphics().

◆ pipelineAO_

std::unique_ptr<AmbientOcclusion> eve::graphics::Graphics::pipelineAO_
protected

在文件 Graphics.h991 行定义.

被这些函数引用 pipelineAmbientOcclusion() , 以及 eve::graphics::vulkan::Graphics::~Graphics().

◆ pipelineGI_

std::unique_ptr<GlobalIllumination> eve::graphics::Graphics::pipelineGI_
protected

在文件 Graphics.h992 行定义.

被这些函数引用 pipelineGlobalIllumination() , 以及 eve::graphics::vulkan::Graphics::~Graphics().

◆ pipelineOutline_

std::unique_ptr<Outline> eve::graphics::Graphics::pipelineOutline_
protected

在文件 Graphics.h994 行定义.

被这些函数引用 pipelineOutline().

◆ pixelHeight

int eve::graphics::Graphics::pixelHeight = 0
protected

◆ pixelWidth

◆ presentOverlayFn_

PresentOverlayFn eve::graphics::Graphics::presentOverlayFn_ = nullptr
protected

◆ presentOverlayUser_

void* eve::graphics::Graphics::presentOverlayUser_ = nullptr
protected

◆ recordingEngine3D_

bool eve::graphics::Graphics::recordingEngine3D_ = false
protected

True while RenderSystem3D is submitting (AO / engine overlays).

在文件 Graphics.h980 行定义.

被这些函数引用 render3D().

◆ renderControl_

◆ screenReadbackEnabled

bool eve::graphics::Graphics::screenReadbackEnabled = false
protected

在文件 Graphics.h981 行定义.

被这些函数引用 isScreenReadbackEnabled(), saveFramePng() , 以及 setScreenReadbackEnabled().

◆ vsyncEnabled

bool eve::graphics::Graphics::vsyncEnabled = true
protected

◆ width

◆ windowDestroyedCallbacks_

std::vector<std::pair<WindowDestroyedCallback, void *> > eve::graphics::Graphics::windowDestroyedCallbacks_
protected

该类的文档由以下文件生成: