载入中...
搜索中...
未找到
eve::graphics::vulkan::Graphics类 参考final

#include <Graphics.h>

类 eve::graphics::vulkan::Graphics 继承关系图:
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

struct  LitBatch
 

Public 成员函数

 ~Graphics () override
 
std::string getBackendName () const override
 Renderer backend id used by sibling modules (e.g. Gpgpu).
 
void initWithWindow (void *nativeWindow) override
 Bind to an existing native window (SDL_Window*) and create Vulkan device/swapchain. Must be called after the window exists (SDL_WINDOW_VULKAN).
 
void present () override
 
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.
 
void onNativeWindowDestroyed () override
 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 setScreenReadbackEnabled (bool enabled) override
 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.
 
void setVSync (bool enabled) override
 Prefer uncapped present (IMMEDIATE/MAILBOX) when false, vsync (MAILBOX/FIFO) when true. Takes effect on the next swapchain recreate.
 
void setMsaaSamples (int samples) override
 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.
 
int getMsaaSamples () const override
 
void setViewportSize (int width, int height, int pixelwidth, int pixelheight) override
 Sets the current graphics display viewport dimensions.
 
void drawSolidRect (float x, float y, float w, float h, const Color &color, BlendMode blend=BlendMode::Alpha) override
 Internal immediate-mode helper used by RenderSystem / Batcher.
 
void drawSolidRectRotated (float cx, float cy, float w, float h, float degrees, const Color &color, BlendMode blend=BlendMode::Alpha) override
 Rotated solid quad degrees clockwise (screen Y-down) around (cx, cy).
 
void pushValidationScope () override
 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).
 
void popValidationScope () override
 
TexturenewTexture (int width, int height, const uint8_t *rgba, bool repeatU=false, bool repeatV=false) override
 
TexturenewTexture (int width, int height, const uint8_t *rgba, const TextureCreateInfo &info) override
 
TexturenewCubemap (int faceSize, const uint8_t *rgbaFaces) override
 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.
 
TexturenewCubemap (int faceSize, const uint8_t *rgbaFaces, const TextureCreateInfo &info) override
 Cubemap with mipmap / sampler options (IBL-friendly when generateMipmaps=true).
 
TexturenewTexture (image::ImageData *data) override
 Create texture from ImageData (RGBA8 required for now).
 
TexturenewTexture (image::ImageData *data, const TextureCreateInfo &info) override
 Create texture from ImageData with sampler / mipmap options.
 
void setTextureSampler (Texture *texture, const TextureSampler &sampler) override
 Recreate the sampler for an existing texture (keeps image / mip chain). No-op when texture is null or not owned by this Graphics.
 
float getMaxAnisotropy () const override
 Device max supported anisotropy (1 if unsupported). Valid after initWithWindow.
 
TexturenewTextureFromFile (const std::string &filename) override
 
bool reloadTextureFromFile (const std::string &filename) override
 Reload a path-cached texture from disk in place (pointer stable). False if unbound.
 
bool releaseTexture (Texture *texture) override
 Eagerly releases a texture created by this Graphics.
 
bool replaceTexturePixels (Texture *tex, image::ImageData *data)
 
void drawTexturedRect (Texture *texture, float x, float y, float w, float h, const Color &color) override
 
void drawTexturedRectShader (Texture *texture, Shader *shader, float x, float y, float w, float h, const Color &color) override
 Draw with an explicit Shader (nullptr = default textured pipeline).
 
void drawTexturedRectUV (Texture *texture, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const Color &color) override
 Draw a textured sub-rect (atlas / tile UVs). texture may be null → solid.
 
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) override
 UV draw with an explicit Shader (nullptr = default textured pipeline).
 
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) override
 UV draw rotated degrees clockwise (screen Y-down) around the rect center. texture may be null → solid. Shader nullptr = default textured pipeline.
 
void drawTexturedRectShaderDepth (Texture *color, Texture *depth, Shader *shader, float x, float y, float w, float h, const Color &tint) override
 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.
 
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) override
 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.
 
void setLighting2D (const Lighting2DUBO &ubo) override
 Upload per-frame / per-canvas 2D lighting constants for subsequent lit draws.
 
ShadernewShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv) override
 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.
 
ShadernewShaderFromSpvFile (const std::string &vertPath, const std::string &fragPath) override
 Load SPIR-V from files via Filesystem (empty vertPath → default textured vert).
 
ShadernewShader (const std::string &vertGlsl, const std::string &fragGlsl) override
 Compile GLSL source with glslc (must be on PATH). Empty vertGlsl → default textured vert. Throws if compilation fails.
 
ShadernewMeshShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv) override
 Create a Mesh3D custom shader (MeshVertex + Frame UBO + albedo). Empty vert → default mesh3d.vert. Owned by Graphics.
 
ShadernewMeshShaderFromWgsl (const std::string &vertWgsl, const std::string &fragWgsl) override
 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).
 
ShadernewMeshShader (const std::string &vertGlsl, const std::string &fragGlsl) override
 
ShadernewHairShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv) override
 Hair/fur card shader (alpha blend + Kajiya-Kay). Empty vert → mesh3d_hair.vert. Owned by Graphics.
 
bool releaseShader (Shader *shader) override
 Eagerly releases a shader created by this Graphics.
 
MeshnewMeshFromAssimp (const ::aiMesh &mesh) override
 
MeshnewMeshFromAssimp (const ::aiMesh &mesh, const aiMatrix4x4 &worldTransform) override
 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.
 
MeshnewMeshFromArrays (const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount) override
 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).
 
bool bakeMeshMorph (Mesh *mesh) override
 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.
 
bool updateMeshVertices (Mesh *mesh, const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount) override
 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.
 
MeshnewMeshSphere (int slices=32, int stacks=16) override
 Procedural UV sphere (radius 1, Y-up). Owned by Graphics. slices = longitude divisions, stacks = latitude divisions.
 
MeshnewMeshCylinder (int slices=32, int stacks=1, bool caps=true) override
 Procedural Y-up cylinder (radius 1, height 2 centered at origin). slices = longitude divisions; stacks = height bands; caps = include end discs. Owned by Graphics.
 
bool releaseMesh (Mesh *mesh) override
 Eagerly releases a mesh created by this Graphics.
 
void begin3DFrame () override
 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().
 
void begin3DFrameToCanvas (Canvas *canvas) override
 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).
 
void end3DFrameToCanvas () override
 
void setMesh3DViewProj (const glm::mat4 &viewProj) override
 
void setMesh3DView (const glm::mat4 &view) override
 Camera view matrix for subsequent drawMesh (view-space depth / CSM select).
 
void setMesh3DClip (float nearZ, float farZ) override
 Near/far used to pack linear depth into scene color A (SSGI).
 
TexturegetSceneColorTexture () override
 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.
 
image::ImageDatarenderEntityIdMask (const std::vector< eve::graphics::Graphics::EntityIdDraw > &draws, const glm::mat4 &viewProj, int width, int height) override
 
image::ImageDatareadGBufferToImageData (const std::string &name) override
 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.
 
void drawMesh (Mesh *mesh, const glm::mat4 &model, Texture *texture, const Color &tint) override
 Draw one mesh with model matrix. Requires begin3DFrame() (or an open swapchain pass).
 
void drawMeshShader (Mesh *mesh, const glm::mat4 &model, Texture *texture, const Color &tint, Shader *shader) override
 Draw mesh with an explicit Mesh3D Shader (nullptr = default PBR pipeline).
 
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) override
 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.
 
void setMesh3DNormalTexture (Texture *normal) override
 Optional normal map for the next drawMesh / drawMeshShader (nullptr = flat).
 
void setMesh3DHeightTexture (Texture *height) override
 Optional height map for parallax (R channel; nullptr = flat / off).
 
void setMesh3DSceneDepth (Texture *depth) override
 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.
 
void setMesh3DMaterial (float metallic, float roughness) override
 Metallic (0..1) and roughness (0..1) for the next default mesh draw.
 
void setMesh3DTexCellBomb (float cellScale, float strength, float rotAmount=1.f) override
 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).
 
void setMesh3DParallax (float scale, float minLayers=8.f, float maxLayers=32.f) override
 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).
 
void setMesh3DLighting (const Lighting3DPack &pack) override
 Per-frame ambient + up to 8 lights packed into Mesh3DUBO.
 
void setCloudShadows (float strength, float worldCell, float time, float windSpeed, float windAngle, float coverage, float detail) override
 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.
 
void setMesh3DClusteredLighting (const ClusteredLightingUpload &upload) override
 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.
 
void setMesh3DClusteredActive (bool active) override
 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.
 
void setMesh3DLight (const glm::vec3 &dir, const glm::vec3 &color) override
 Directional light for subsequent drawMesh calls (world-space direction toward surface).
 
void setMesh3DCameraPos (const glm::vec3 &eye) override
 Camera eye used by mesh shaders that need view/rim (stored in Mesh3DUBO).
 
void setMesh3DEnv (Texture *cube, float intensity) override
 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.
 
void setMesh3DShadows (const ShadowUpload &upload) override
 Upload CSM constants for subsequent default mesh draws (active=false disables).
 
void setMesh3DShadowReceive (bool receive) override
 Per-draw: when false, shadow sampling is forced off for the next mesh draw.
 
void beginShadowPass (int cascadeIndex) override
 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.
 
void drawMeshShadow (Mesh *mesh, const glm::mat4 &lightMVP) override
 
void drawMeshShadowAlpha (Mesh *mesh, const glm::mat4 &lightMVP, Texture *albedo=nullptr) override
 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).
 
void endShadowPass () override
 
void beginGBufferPass (int width, int height) override
 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().
 
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) override
 
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) override
 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).
 
void endGBufferPass () override
 
CanvasnewCanvas (int width, int height) override
 Create an offscreen render target (sampleable). Owned by Graphics.
 
void setCanvas (Canvas *canvas) override
 nullptr or this → screen. Switching flushes pending draws to the previous target.
 
bool isCanvasActive () const override
 
CanvasgetCanvas () const override
 
TexturegetTexture () override
 Sampleable color buffer; screen Canvas returns nullptr.
 
image::ImageDatanewImageData () override
 
void draw (eve::graphics::Graphics *gfx, const glm::mat4 &matrix) const override
 Draws the object with the specified transformation matrix.
 
void draw (Canvas *C, const glm::mat4 &matrix) const override
 
void clear (std::optional< Color > color, std::optional< int > stencil, std::optional< double > depth) override
 
Color getPixel (int x, int y) override
 
vkb::Device & getDevice ()
 
vk::CommandPool getUploadPool () const
 
vk::DescriptorSetLayout getTexSetLayout () const
 
vk::DescriptorPool getDescriptorPool () const
 
const vkb::BuiltRenderPass & getOffscreenRenderPass () const
 
const vkb::BuiltRenderPass & getOffscreen3DRenderPass ()
 
vk::Format getDepthFormat () const
 
vk::RenderPass getSwapchainRenderPass () const
 
vk::RenderPass getUiMsaaRenderPass () const
 
vk::SampleCountFlagBits getUiMsaaSamples () const
 Sample count the UI MSAA pass runs with (matches getUiMsaaRenderPass).
 
void ensureUiColorResources ()
 Create the UI MSAA render pass (once) and its color targets for ImGui init.
 
vkb::Instance & getInstance ()
 
vkb::Swapchain & getSwapchain ()
 
void * getSdlWindow () const
 
uint32_t getSwapchainImageCount () const
 
- Public 成员函数 继承自 eve::graphics::Graphics
 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 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.
 
int getWidth () const
 
int getHeight () const
 
int getPixelWidth () const
 
int getPixelHeight () const
 
double getCurrentDPIScale () const
 
double getScreenDPIScale () const
 
TexturenewTextureFromFileRepeated (const std::string &filename, bool repeatU, bool repeatV)
 
QuadnewQuad (int x, int y, int w, int h)
 Pixel-space atlas rect. Caller owns Quad* (not tracked 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 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)
 
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 image::ImageDatarenderEntityIdMask (const std::vector< EntityIdDraw > &draws, const glm::mat4 &viewProj, int width, int height)
 
bool consumeFrameHad3D ()
 True after begin3DFrame until present completes.
 
bool had3DThisFrame () const
 
Color getBackgroundColor () const
 
void setBackgroundColor (const Color &c)
 
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.
 
bool isVSync () const
 
void setActive (bool active) override
 Pause/resume presenting (Android background / foreground).
 
bool isActive () const
 
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
 
ShadernewShaderFromSpvFile (const std::string &fragPath)
 
ShadernewShader (const std::string &fragGlsl)
 
ShadernewMeshShader (const std::string &fragGlsl)
 
ShadernewHairShader ()
 Built-in hair shader with default anisotropic parameters.
 
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.
 
void setCanvas ()
 
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
 
- Public 成员函数 继承自 eve::graphics::Drawable
virtual ~Drawable ()
 
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
 

友元

class OffscreenCanvas
 

额外继承的成员函数

- Public 类型 继承自 eve::graphics::Graphics
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 属性 继承自 eve::IWindowSurfaceHost
static constexpr const char * capabilityName = "IWindowSurfaceHost"
 
- Protected 成员函数 继承自 eve::graphics::Graphics
ShaderprepareSceneColorResolveShader (Texture *scene)
 FXAA resolve shader that writes opaque RGB (ignores scene-color depth alpha).
 
- Protected 属性 继承自 eve::graphics::Graphics
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_
 

详细描述

在文件 Graphics.h171 行定义.

构造及析构函数说明

◆ ~Graphics()

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

成员函数说明

◆ bakeMeshMorph()

bool eve::graphics::vulkan::Graphics::bakeMeshMorph ( Mesh mesh)
overridevirtual

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::Graphics.

在文件 GraphicsMesh.cpp244 行定义.

引用了 eve::graphics::Mesh::computeMorphedPositions(), getDevice(), mesh, eve::graphics::vulkan::MeshVertex::pos, pos, v , 以及 verts.

◆ begin3DFrame()

void eve::graphics::vulkan::Graphics::begin3DFrame ( )
overridevirtual

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::Graphics.

在文件 Graphics3D.cpp59 行定义.

引用了 eve::graphics::Graphics::backgroundColor, eve::graphics::Graphics::frameHad3D , 以及 isCanvasActive().

◆ begin3DFrameToCanvas()

void eve::graphics::vulkan::Graphics::begin3DFrameToCanvas ( Canvas canvas)
overridevirtual

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::Graphics.

在文件 Graphics3D.cpp169 行定义.

引用了 eve::graphics::Graphics::backgroundColor , 以及 eve::graphics::Graphics::frameHad3D.

◆ beginGBufferPass()

void eve::graphics::vulkan::Graphics::beginGBufferPass ( int  width,
int  height 
)
overridevirtual

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::Graphics.

在文件 Graphics3D.cpp548 行定义.

引用了 eve::graphics::Graphics::height , 以及 eve::graphics::Graphics::width.

◆ beginShadowPass()

void eve::graphics::vulkan::Graphics::beginShadowPass ( int  cascadeIndex)
overridevirtual

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::Graphics.

在文件 Graphics3D.cpp504 行定义.

引用了 eve::graphics::ShadowConfig::kCascades.

◆ clear()

void eve::graphics::vulkan::Graphics::clear ( std::optional< Color color,
std::optional< int >  stencil,
std::optional< double >  depth 
)
overridevirtual

◆ draw() [1/2]

void eve::graphics::vulkan::Graphics::draw ( Canvas C,
const glm::mat4 &  matrix 
) const
overridevirtual

实现了 eve::graphics::Canvas.

在文件 Graphics.cpp578 行定义.

◆ draw() [2/2]

void eve::graphics::vulkan::Graphics::draw ( eve::graphics::Graphics gfx,
const glm::mat4 &  matrix 
) const
overridevirtual

Draws the object with the specified transformation matrix.

实现了 eve::graphics::Drawable.

在文件 Graphics.cpp577 行定义.

◆ drawMesh()

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

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

实现了 eve::graphics::Graphics.

在文件 GraphicsMesh.cpp531 行定义.

引用了 drawMeshShader(), mesh , 以及 model.

◆ drawMeshGBuffer()

void eve::graphics::vulkan::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 
)
overridevirtual

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp559 行定义.

引用了 albedo, d, mesh, model , 以及 x.

◆ drawMeshGBufferAlpha()

void eve::graphics::vulkan::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 
)
overridevirtual

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::Graphics.

在文件 Graphics3D.cpp578 行定义.

引用了 albedo, d, mesh, model , 以及 x.

◆ drawMeshShader()

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

◆ drawMeshShadow()

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

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp514 行定义.

引用了 mesh.

◆ drawMeshShadowAlpha()

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

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::Graphics.

在文件 Graphics3D.cpp520 行定义.

引用了 albedo, d , 以及 mesh.

◆ drawSolidRect()

void eve::graphics::vulkan::Graphics::drawSolidRect ( float  x,
float  y,
float  w,
float  h,
const Color color,
BlendMode  blend = BlendMode::Alpha 
)
overridevirtual

Internal immediate-mode helper used by RenderSystem / Batcher.

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp492 行定义.

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

◆ drawSolidRectRotated()

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

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp504 行定义.

引用了 color, cx, cy, degrees, h , 以及 w.

◆ drawTexturedRect()

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

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::Graphics.

在文件 Graphics2D.cpp857 行定义.

引用了 color, eve::graphics::Graphics::drawTexturedRectUV(), h, w, x , 以及 y.

◆ drawTexturedRectLitUV()

void eve::graphics::vulkan::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 
)
overridevirtual

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::Graphics.

在文件 Graphics2D.cpp934 行定义.

引用了 albedo, color, eve::graphics::Graphics::drawSolidRect(), h, normal, w, x , 以及 y.

◆ drawTexturedRectShader()

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

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp861 行定义.

引用了 color, eve::graphics::Graphics::drawTexturedRectShaderUV(), h, shader, w, x , 以及 y.

◆ drawTexturedRectShaderDepth()

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

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::Graphics.

在文件 Graphics2D.cpp907 行定义.

引用了 eve::graphics::Alpha, color, depth, eve::graphics::Graphics::drawSolidRect(), eve::graphics::Graphics::drawTexturedRectShader(), h, shader, w, x , 以及 y.

◆ drawTexturedRectShaderUV()

void eve::graphics::vulkan::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 
)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp871 行定义.

引用了 color, eve::graphics::Texture::depth, eve::graphics::Graphics::drawSolidRect(), h, shader, w, x , 以及 y.

◆ drawTexturedRectShaderUVRotated()

void eve::graphics::vulkan::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 
)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp888 行定义.

引用了 color, cx, cy, degrees, eve::graphics::Texture::depth, eve::graphics::Graphics::drawSolidRect(), h, shader , 以及 w.

◆ drawTexturedRectUV()

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

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp866 行定义.

引用了 color, eve::graphics::Graphics::currentShader, eve::graphics::Graphics::drawTexturedRectShaderUV(), h, w, x , 以及 y.

◆ drawVoxelFaceInstances()

void eve::graphics::vulkan::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 
)
overridevirtual

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::Graphics.

在文件 Graphics3D.cpp402 行定义.

引用了 eve::graphics::Texture::gpuHandle, eve::graphics::vulkan::Mesh3DUBO::mvp , 以及 eve::graphics::vulkan::Mesh3DUBO::tint.

◆ end3DFrameToCanvas()

void eve::graphics::vulkan::Graphics::end3DFrameToCanvas ( )
overridevirtual

◆ endGBufferPass()

void eve::graphics::vulkan::Graphics::endGBufferPass ( )
overridevirtual

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp599 行定义.

引用了 albedo , 以及 eve::graphics::Graphics::renderControl_.

◆ endShadowPass()

void eve::graphics::vulkan::Graphics::endShadowPass ( )
overridevirtual

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp531 行定义.

◆ ensureUiColorResources()

void eve::graphics::vulkan::Graphics::ensureUiColorResources ( )
inline

Create the UI MSAA render pass (once) and its color targets for ImGui init.

在文件 Graphics.h332 行定义.

◆ getBackendName()

std::string eve::graphics::vulkan::Graphics::getBackendName ( ) const
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics.cpp56 行定义.

◆ getCanvas()

Canvas * eve::graphics::vulkan::Graphics::getCanvas ( ) const
overridevirtual

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp426 行定义.

◆ getDepthFormat()

vk::Format eve::graphics::vulkan::Graphics::getDepthFormat ( ) const
inline

在文件 Graphics.h326 行定义.

被这些函数引用 eve::graphics::vulkan::OffscreenCanvas::ensure3D().

◆ getDescriptorPool()

vk::DescriptorPool eve::graphics::vulkan::Graphics::getDescriptorPool ( ) const
inline

在文件 Graphics.h323 行定义.

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

◆ getDevice()

◆ getInstance()

vkb::Instance & eve::graphics::vulkan::Graphics::getInstance ( )
inline

在文件 Graphics.h335 行定义.

◆ getMaxAnisotropy()

float eve::graphics::vulkan::Graphics::getMaxAnisotropy ( ) const
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp517 行定义.

◆ getMsaaSamples()

int eve::graphics::vulkan::Graphics::getMsaaSamples ( ) const
inlineoverridevirtual

重载 eve::graphics::Graphics .

在文件 Graphics.h195 行定义.

引用了 eve::graphics::Graphics::msaaSamples.

◆ getOffscreen3DRenderPass()

const vkb::BuiltRenderPass & eve::graphics::vulkan::Graphics::getOffscreen3DRenderPass ( )
inline

在文件 Graphics.h325 行定义.

被这些函数引用 eve::graphics::vulkan::OffscreenCanvas::ensure3D().

◆ getOffscreenRenderPass()

const vkb::BuiltRenderPass & eve::graphics::vulkan::Graphics::getOffscreenRenderPass ( ) const
inline

在文件 Graphics.h324 行定义.

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

◆ getPixel()

Color eve::graphics::vulkan::Graphics::getPixel ( int  x,
int  y 
)
overridevirtual

◆ getSceneColorTexture()

Texture * eve::graphics::vulkan::Graphics::getSceneColorTexture ( )
overridevirtual

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::Graphics .

在文件 Graphics.cpp410 行定义.

◆ getSdlWindow()

void * eve::graphics::vulkan::Graphics::getSdlWindow ( ) const
inline

在文件 Graphics.h337 行定义.

◆ getSwapchain()

vkb::Swapchain & eve::graphics::vulkan::Graphics::getSwapchain ( )
inline

在文件 Graphics.h336 行定义.

◆ getSwapchainImageCount()

uint32_t eve::graphics::vulkan::Graphics::getSwapchainImageCount ( ) const
inline

在文件 Graphics.h338 行定义.

◆ getSwapchainRenderPass()

vk::RenderPass eve::graphics::vulkan::Graphics::getSwapchainRenderPass ( ) const
inline

在文件 Graphics.h327 行定义.

◆ getTexSetLayout()

vk::DescriptorSetLayout eve::graphics::vulkan::Graphics::getTexSetLayout ( ) const
inline

在文件 Graphics.h322 行定义.

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

◆ getTexture()

Texture * eve::graphics::vulkan::Graphics::getTexture ( )
overridevirtual

Sampleable color buffer; screen Canvas returns nullptr.

实现了 eve::graphics::Canvas.

在文件 GraphicsPipeline.cpp1384 行定义.

◆ getUiMsaaRenderPass()

vk::RenderPass eve::graphics::vulkan::Graphics::getUiMsaaRenderPass ( ) const
inline

在文件 Graphics.h328 行定义.

◆ getUiMsaaSamples()

vk::SampleCountFlagBits eve::graphics::vulkan::Graphics::getUiMsaaSamples ( ) const
inline

Sample count the UI MSAA pass runs with (matches getUiMsaaRenderPass).

在文件 Graphics.h330 行定义.

◆ getUploadPool()

vk::CommandPool eve::graphics::vulkan::Graphics::getUploadPool ( ) const
inline

在文件 Graphics.h321 行定义.

被这些函数引用 eve::gpgpu::computeCommandPool().

◆ initWithWindow()

void eve::graphics::vulkan::Graphics::initWithWindow ( void *  nativeWindow)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics.cpp139 行定义.

引用了 name, newTexture() , 以及 setViewportSize().

◆ isCanvasActive()

bool eve::graphics::vulkan::Graphics::isCanvasActive ( ) const
overridevirtual

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp422 行定义.

被这些函数引用 begin3DFrame() , 以及 present().

◆ newCanvas()

Canvas * eve::graphics::vulkan::Graphics::newCanvas ( int  width,
int  height 
)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp398 行定义.

引用了 c, h , 以及 w.

◆ newCubemap() [1/2]

Texture * eve::graphics::vulkan::Graphics::newCubemap ( int  faceSize,
const uint8_t *  rgbaFaces 
)
overridevirtual

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::Graphics.

在文件 Graphics2D.cpp626 行定义.

引用了 eve::graphics::Graphics::newCubemap() , 以及 eve::graphics::TextureCreateInfo::withMipmaps().

◆ newCubemap() [2/2]

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

◆ newHairShaderFromSpv()

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

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp1128 行定义.

引用了 eve::graphics::Shader::eMesh3D , 以及 vert.

◆ newImageData()

image::ImageData * eve::graphics::vulkan::Graphics::newImageData ( )
overridevirtual

Full RGBA8 copy; caller owns ImageData*.

实现了 eve::graphics::Canvas.

在文件 Graphics2D.cpp208 行定义.

引用了 eve::graphics::Graphics::pixelHeight , 以及 eve::graphics::Graphics::pixelWidth.

◆ newMeshCylinder()

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

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::Graphics.

在文件 GraphicsMesh.cpp422 行定义.

引用了 cx, i0, i1, i2, eve::graphics::vulkan::MeshVertex::pos, px, u, v, vert, verts, x , 以及 y.

◆ newMeshFromArrays()

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

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::Graphics.

在文件 GraphicsMesh.cpp207 行定义.

引用了 eve::graphics::Mesh::computeBounds(), idx, eve::graphics::vulkan::MeshVertex::pos, v , 以及 verts.

◆ newMeshFromAssimp() [1/2]

Mesh * eve::graphics::vulkan::Graphics::newMeshFromAssimp ( const ::aiMesh &  mesh)
overridevirtual

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::Graphics.

在文件 GraphicsMesh.cpp51 行定义.

引用了 f, m, mesh, name, eve::graphics::vulkan::MeshVertex::pos, v , 以及 verts.

被这些函数引用 newMeshFromAssimp().

◆ newMeshFromAssimp() [2/2]

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

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::Graphics.

在文件 GraphicsMesh.cpp134 行定义.

引用了 f, idx, mesh , 以及 newMeshFromAssimp().

◆ newMeshShader()

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp1192 行定义.

引用了 frag, eve::graphics::Graphics::newMeshShaderFromSpv() , 以及 vert.

◆ newMeshShaderFromSpv()

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

Create a Mesh3D custom shader (MeshVertex + Frame UBO + albedo). Empty vert → default mesh3d.vert. Owned by Graphics.

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp1092 行定义.

引用了 eve::graphics::Shader::eMesh3D , 以及 vert.

◆ newMeshShaderFromWgsl()

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

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::Graphics.

在文件 Graphics2D.cpp1200 行定义.

◆ newMeshSphere()

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

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

实现了 eve::graphics::Graphics.

在文件 GraphicsMesh.cpp338 行定义.

引用了 i0, i1, i2, eve::graphics::vulkan::MeshVertex::pos, px, u, v, vert, verts, x , 以及 y.

◆ newShader()

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

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp1084 行定义.

引用了 frag, eve::graphics::Graphics::newShaderFromSpv() , 以及 vert.

◆ newShaderFromSpv()

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

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::Graphics.

在文件 Graphics2D.cpp1045 行定义.

引用了 vert.

◆ newShaderFromSpvFile()

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

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp1076 行定义.

引用了 frag, eve::graphics::Graphics::newShaderFromSpv() , 以及 vert.

◆ newTexture() [1/4]

Texture * eve::graphics::vulkan::Graphics::newTexture ( image::ImageData data)
overridevirtual

Create texture from ImageData (RGBA8 required for now).

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp680 行定义.

引用了 data , 以及 eve::graphics::Graphics::newTexture().

◆ newTexture() [2/4]

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

Create texture from ImageData with sampler / mipmap options.

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp689 行定义.

引用了 data , 以及 eve::graphics::Graphics::newTexture().

◆ newTexture() [3/4]

Texture * eve::graphics::vulkan::Graphics::newTexture ( int  width,
int  height,
const uint8_t *  rgba,
bool  repeatU = false,
bool  repeatV = false 
)
overridevirtual

Create RGBA8 texture from CPU pixels (size = width*height*4). Borrowed handle: Graphics owns the texture (freed at shutdown or via releaseTexture); callers must not delete it.

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp572 行定义.

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

被这些函数引用 initWithWindow().

◆ newTexture() [4/4]

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

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::Graphics.

在文件 Graphics2D.cpp579 行定义.

引用了 device, eve::graphics::TextureCreateInfo::generateMipmaps, h, eve::graphics::mipmapCountForSize(), eve::graphics::TextureCreateInfo::sampler , 以及 w.

◆ newTextureFromFile()

Texture * eve::graphics::vulkan::Graphics::newTextureFromFile ( const std::string &  filename)
overridevirtual

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::Graphics.

在文件 Graphics2D.cpp819 行定义.

引用了 data , 以及 eve::graphics::Graphics::newTexture().

◆ onNativeWindowDestroyed()

void eve::graphics::vulkan::Graphics::onNativeWindowDestroyed ( )
overridevirtual

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::graphics::Graphics .

在文件 Graphics.cpp272 行定义.

引用了 eve::graphics::Graphics::clearPresentOverlay() , 以及 eve::graphics::Graphics::windowDestroyedCallbacks_.

◆ popValidationScope()

void eve::graphics::vulkan::Graphics::popValidationScope ( )
inlineoverridevirtual

实现了 eve::graphics::Graphics.

在文件 Graphics.h203 行定义.

◆ present()

void eve::graphics::vulkan::Graphics::present ( )
overridevirtual

实现了 eve::graphics::Graphics.

在文件 Graphics.cpp560 行定义.

引用了 eve::graphics::Graphics::isActive() , 以及 isCanvasActive().

◆ pushValidationScope()

void eve::graphics::vulkan::Graphics::pushValidationScope ( )
inlineoverridevirtual

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::Graphics.

在文件 Graphics.h202 行定义.

◆ readGBufferToImageData()

image::ImageData * eve::graphics::vulkan::Graphics::readGBufferToImageData ( const std::string &  name)
overridevirtual

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::Graphics .

在文件 Graphics2D.cpp357 行定义.

引用了 device, h, name , 以及 w.

◆ releaseMesh()

bool eve::graphics::vulkan::Graphics::releaseMesh ( Mesh mesh)
overridevirtual

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::Graphics .

在文件 GraphicsMesh.cpp312 行定义.

引用了 m , 以及 mesh.

◆ releaseShader()

bool eve::graphics::vulkan::Graphics::releaseShader ( Shader shader)
overridevirtual

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::Graphics .

在文件 Graphics2D.cpp1161 行定义.

引用了 device, s , 以及 shader.

◆ releaseTexture()

bool eve::graphics::vulkan::Graphics::releaseTexture ( Texture texture)
overridevirtual

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::Graphics .

在文件 Graphics2D.cpp715 行定义.

引用了 device , 以及 eve::graphics::Texture::gpuHandle.

◆ reloadTextureFromFile()

bool eve::graphics::vulkan::Graphics::reloadTextureFromFile ( const std::string &  filename)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp839 行定义.

引用了 data , 以及 eve::ref< T >::get().

◆ renderEntityIdMask()

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

◆ replaceTexturePixels()

◆ requestSurfaceRecreate()

void eve::graphics::vulkan::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::graphics::Graphics .

在文件 Graphics.h179 行定义.

◆ setCanvas()

void eve::graphics::vulkan::Graphics::setCanvas ( Canvas canvas)
overridevirtual

nullptr or this → screen. Switching flushes pending draws to the previous target.

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp411 行定义.

◆ setCloudShadows()

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

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::Graphics.

在文件 Graphics3D.cpp684 行定义.

引用了 eve::graphics::vulkan::Mesh3DUBO::cloud , 以及 eve::graphics::vulkan::Mesh3DUBO::cloudWind.

◆ setLighting2D()

void eve::graphics::vulkan::Graphics::setLighting2D ( const Lighting2DUBO ubo)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp926 行定义.

◆ setMesh3DCameraPos()

void eve::graphics::vulkan::Graphics::setMesh3DCameraPos ( const glm::vec3 &  eye)
overridevirtual

Camera eye used by mesh shaders that need view/rim (stored in Mesh3DUBO).

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp256 行定义.

引用了 eve::graphics::vulkan::Mesh3DUBO::cameraPos , 以及 eye.

◆ setMesh3DClip()

void eve::graphics::vulkan::Graphics::setMesh3DClip ( float  nearZ,
float  farZ 
)
overridevirtual

Near/far used to pack linear depth into scene color A (SSGI).

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp760 行定义.

引用了 eve::graphics::ClusteredLightingUpload::clipInfo, eve::graphics::vulkan::Mesh3DUBO::clipInfo, f , 以及 n.

◆ setMesh3DClusteredActive()

void eve::graphics::vulkan::Graphics::setMesh3DClusteredActive ( bool  active)
overridevirtual

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::Graphics.

在文件 GraphicsPipeline.cpp1156 行定义.

引用了 active.

◆ setMesh3DClusteredLighting()

void eve::graphics::vulkan::Graphics::setMesh3DClusteredLighting ( const ClusteredLightingUpload upload)
overridevirtual

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::Graphics.

在文件 GraphicsPipeline.cpp1150 行定义.

引用了 eve::graphics::ClusteredLightingUpload::active.

◆ setMesh3DEnv()

void eve::graphics::vulkan::Graphics::setMesh3DEnv ( Texture cube,
float  intensity 
)
overridevirtual

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::Graphics.

在文件 Graphics3D.cpp494 行定义.

◆ setMesh3DHeightTexture()

void eve::graphics::vulkan::Graphics::setMesh3DHeightTexture ( Texture height)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp490 行定义.

引用了 eve::graphics::Graphics::height.

◆ setMesh3DLight()

void eve::graphics::vulkan::Graphics::setMesh3DLight ( const glm::vec3 &  dir,
const glm::vec3 &  color 
)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp248 行定义.

引用了 color, d, dir, eve::graphics::vulkan::Mesh3DUBO::lightColor , 以及 eve::graphics::vulkan::Mesh3DUBO::lightDir.

◆ setMesh3DLighting()

◆ setMesh3DMaterial()

void eve::graphics::vulkan::Graphics::setMesh3DMaterial ( float  metallic,
float  roughness 
)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp632 行定义.

引用了 eve::graphics::vulkan::Mesh3DUBO::ambient, eve::graphics::vulkan::Mesh3DUBO::cameraPos, metallic , 以及 roughness.

◆ setMesh3DNormalTexture()

void eve::graphics::vulkan::Graphics::setMesh3DNormalTexture ( Texture normal)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp488 行定义.

引用了 normal.

◆ setMesh3DParallax()

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

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::Graphics.

在文件 Graphics3D.cpp647 行定义.

引用了 eve::graphics::vulkan::Mesh3DUBO::parallax , 以及 scale.

◆ setMesh3DSceneDepth()

void eve::graphics::vulkan::Graphics::setMesh3DSceneDepth ( Texture depth)
overridevirtual

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::Graphics.

在文件 Graphics3D.cpp492 行定义.

引用了 depth.

◆ setMesh3DShadowReceive()

void eve::graphics::vulkan::Graphics::setMesh3DShadowReceive ( bool  receive)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp502 行定义.

◆ setMesh3DShadows()

void eve::graphics::vulkan::Graphics::setMesh3DShadows ( const ShadowUpload upload)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp500 行定义.

◆ setMesh3DTexCellBomb()

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

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::Graphics.

在文件 Graphics3D.cpp639 行定义.

引用了 eve::graphics::vulkan::Mesh3DUBO::texBomb.

◆ setMesh3DView()

void eve::graphics::vulkan::Graphics::setMesh3DView ( const glm::mat4 &  view)
overridevirtual

Camera view matrix for subsequent drawMesh (view-space depth / CSM select).

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp756 行定义.

引用了 view , 以及 eve::graphics::vulkan::Mesh3DUBO::view.

◆ setMesh3DViewProj()

void eve::graphics::vulkan::Graphics::setMesh3DViewProj ( const glm::mat4 &  viewProj)
overridevirtual

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

实现了 eve::graphics::Graphics.

在文件 Graphics3D.cpp752 行定义.

引用了 eve::graphics::vulkan::Mesh3DUBO::mvp , 以及 viewProj.

◆ setMsaaSamples()

void eve::graphics::vulkan::Graphics::setMsaaSamples ( int  samples)
inlineoverridevirtual

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::Graphics .

在文件 Graphics.h190 行定义.

引用了 eve::graphics::Graphics::msaaSamples , 以及 eve::graphics::Graphics::setMsaaSamples().

◆ setScreenReadbackEnabled()

void eve::graphics::vulkan::Graphics::setScreenReadbackEnabled ( bool  enabled)
inlineoverridevirtual

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::Graphics .

在文件 Graphics.h181 行定义.

引用了 enabled , 以及 eve::graphics::Graphics::setScreenReadbackEnabled().

◆ setTextureSampler()

void eve::graphics::vulkan::Graphics::setTextureSampler ( Texture texture,
const TextureSampler sampler 
)
overridevirtual

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::Graphics.

在文件 Graphics2D.cpp699 行定义.

引用了 device, eve::graphics::Texture::gpuHandle , 以及 eve::graphics::Texture::sampler.

◆ setViewportSize()

void eve::graphics::vulkan::Graphics::setViewportSize ( int  width,
int  height,
int  pixelwidth,
int  pixelheight 
)
overridevirtual

Sets the current graphics display viewport dimensions.

实现了 eve::graphics::Graphics.

在文件 Graphics2D.cpp430 行定义.

引用了 eve::graphics::Graphics::height, eve::graphics::Graphics::pixelHeight, eve::graphics::Graphics::pixelWidth , 以及 eve::graphics::Graphics::width.

被这些函数引用 initWithWindow().

◆ setVSync()

void eve::graphics::vulkan::Graphics::setVSync ( bool  enabled)
inlineoverridevirtual

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

重载 eve::graphics::Graphics .

在文件 Graphics.h185 行定义.

引用了 enabled, eve::graphics::Graphics::setVSync() , 以及 eve::graphics::Graphics::vsyncEnabled.

◆ updateMeshVertices()

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

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::Graphics.

在文件 GraphicsMesh.cpp280 行定义.

引用了 getDevice(), mesh, eve::graphics::vulkan::MeshVertex::pos, v , 以及 verts.

友元及相关函数文档

◆ OffscreenCanvas

friend class OffscreenCanvas
friend

在文件 Graphics.h340 行定义.


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