载入中...
搜索中...
未找到
Graphics.h
浏览该文件的文档.
70 virtual void drawSolidRectRGBA(float x, float y, float w, float h, float r, float g, float b, float a = 1.f);
71 virtual void drawTexturedRectRGBA(Texture *texture, float x, float y, float w, float h, float r, float g, float b,
91 virtual void setTextureSamplerParams(Texture *texture, const std::string &filter, const std::string &mipmap,
211 virtual void drawTexturedRectShader(Texture *texture, Shader *shader, float x, float y, float w,
337 virtual void setDirectionalLight(float dx, float dy, float dz, float r = 1.f, float g = 1.f, float b = 1.f);
345 virtual void drawScene3DRGBA(float x, float y, float w, float h, float r = 1.f, float g = 1.f, float b = 1.f,
353 virtual void drawCanvasRGBA(Canvas *canvas, float x, float y, float w, float h, float r = 1.f, float g = 1.f,
467 virtual void drawMesh(Mesh *mesh, const glm::mat4 &model, Texture *texture, const Color &tint) = 0;
470 virtual void drawMeshShader(Mesh *mesh, const glm::mat4 &model, Texture *texture, const Color &tint,
697 virtual void print(const std::string &text, float x, float y, const Color &color = Color(1.f, 1.f, 1.f, 1.f),
713 virtual Shader *newShaderFromSpvFile(const std::string &vertPath, const std::string &fragPath) = 0;
901 void rectangle(std::string mode, float x, float y, float w, float h, float rx, float ry, int points);
938 void arc(std::string mode, std::string arcmode, float x, float y, float radius, float angle1, float angle2,
940 void arc(std::string mode, std::string arcmode, float x, float y, float radius, float angle1, float angle2);
948 void polygon(std::string mode, const std::vector<glm::vec2> &vertices, bool skipLastFilledVertex = true);
Render-surface host for the window module (provided by graphics).
Definition WindowSurfaceHost.h:27
Definition Module.h:43
CPU-side decoded font face (FreeType FT_Face + owned font bytes). Does not upload to GPU — rasterize ...
Definition FontData.h:23
Definition RenderSystem3D.h:18
Definition Canvas.h:16
GPU-side font: wraps a decoded font::FontData and rasterizes a fixed set of codepoints into a single ...
Definition Font.h:32
static std::string defaultCharset()
Printable ASCII (0x20..0x7E), used when no explicit charset is given.
Definition Font.cpp:58
Screen-space single-bounce GI (SSGI).
Definition GlobalIllumination.h:27
Definition Graphics.h:56
virtual void reset()
Resets the current color, background color, line style, and so forth.
Definition Graphics.cpp:740
virtual void setFont(Font *font)
Font used by subsequent print() calls; nullptr = none set.
Definition Graphics.h:690
virtual Texture * newCubemap(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,...
virtual void beginShadowPass(int cascadeIndex)=0
Depth-only shadow pass for one cascade layer (0..2). Draws are recorded into the next begin3DFrame co...
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).
Definition Graphics.cpp:919
virtual void draw(Drawable *drawable, const glm::mat4 &m)
Definition Graphics.cpp:848
std::vector< std::pair< WindowDestroyedCallback, void * > > windowDestroyedCallbacks_
Definition Graphics.h:987
Volumetric * newVolumetric()
Volumetric light + fog (screenspace / raymarch / fog). Caller owns Volumetric*; its Shaders are owned...
Definition Graphics.cpp:749
virtual image::ImageData * renderEntityIdMask(const std::vector< EntityIdDraw > &draws, const glm::mat4 &viewProj, int width, int height)
Definition Graphics.h:446
virtual void onNativeWindowDestroyed()
Called by the Window module when the native window backing the render surface is destroyed (window cl...
Definition Graphics.h:646
void(*)(void *userdata) WindowDestroyedCallback
Register a callback invoked when the native window is destroyed. Used by the UI backend to tear down ...
Definition Graphics.h:663
void drawCanvas(Canvas *canvas, float x, float y, float w, float h)
Definition Graphics.h:355
virtual bool releaseMesh(Mesh *mesh)
Eagerly releases a mesh created by this Graphics.
Definition Graphics.h:324
void ellipse(std::string mode, float x, float y, float a, float b)
virtual std::string getBackendName() const =0
Renderer backend id used by sibling modules (e.g. Gpgpu).
virtual void setDirectionalLight(float dx, float dy, float dz, float r=1.f, float g=1.f, float b=1.f)
Definition Graphics.cpp:167
virtual void setVSync(bool enabled)
Prefer uncapped present (IMMEDIATE/MAILBOX) when false, vsync (MAILBOX/FIFO) when true....
Definition Graphics.h:604
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 ou...
std::unique_ptr< AntiAliasing > pipelineAA_
Definition Graphics.h:993
virtual Shader * newMeshShaderFromSpv(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....
void setBackgroundColor(const Color &c)
Definition Graphics.h:585
virtual void setMesh3DShadows(const ShadowUpload &upload)=0
Upload CSM constants for subsequent default mesh draws (active=false disables).
void ellipse(std::string mode, float x, float y, float a, float b, int points)
Draws an ellipse using the specified arguments.
virtual void endGBufferPass()=0
virtual void setMesh3DClip(float nearZ, float farZ)=0
Near/far used to pack linear depth into scene color A (SSGI).
void setActive(bool active) override
Pause/resume presenting (Android background / foreground).
Definition Graphics.h:616
void translate(float x, float y)
virtual Mesh * newMeshCylinder(int slices=32, int stacks=1, bool caps=true)=0
Procedural Y-up cylinder (radius 1, height 2 centered at origin). slices = longitude divisions; stack...
std::unique_ptr< Outline > pipelineOutline_
Definition Graphics.h:994
Shader * newHairShader()
Built-in hair shader with default anisotropic parameters.
Definition Graphics.cpp:781
virtual void setMesh3DMaterial(float metallic, float roughness)=0
Metallic (0..1) and roughness (0..1) for the next default mesh draw.
Texture * newTextureWithSampler(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"....
Definition Graphics.cpp:903
void polyline(const glm::mat4 *vertices, size_t count)
Draws a series of lines connecting the given vertices.
virtual void drawOcclusionTexture(Texture *texture, float x, float y, float w, float h)
Definition Graphics.cpp:860
virtual void setBackgroundColorRGBA(float r, float g, float b, float a=1.f)
Definition Graphics.cpp:867
bool isScreenReadbackEnabled() const
Definition Graphics.h:592
GrassField * newGrassField()
Dense + sparse stylized grass field. Caller owns GrassField*; its Mesh / Shader / Texture are owned b...
Definition Graphics.cpp:785
AmbientOcclusion * newAmbientOcclusion()
Screen-space ambient occlusion (ssao / hbao / gtao). Caller owns AmbientOcclusion*; its Shaders are o...
Definition Graphics.cpp:751
virtual bool releaseTexture(Texture *texture)
Eagerly releases a texture created by this Graphics.
Definition Graphics.h:200
Quad * newQuad(int x, int y, int w, int h)
Pixel-space atlas rect. Caller owns Quad* (not tracked by Graphics).
Definition Graphics.cpp:931
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 Shader * newMeshShader(const std::string &vertGlsl, const std::string &fragGlsl)=0
virtual void setMesh3DViewProj(const glm::mat4 &viewProj)=0
virtual image::ImageData * readGBufferToImageData(const std::string &name)
Read a G-buffer attachment back to CPU as RGBA8. name is one of "depth" (RGBA8 linear depth),...
Definition Graphics.h:461
Module_REG(Graphics)
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 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 Texture * newTexture(image::ImageData *data)=0
Create texture from ImageData (RGBA8 required for now).
virtual void setMesh3DCameraPos(const glm::vec3 &eye)=0
Camera eye used by mesh shaders that need view/rim (stored in Mesh3DUBO).
Color getBackgroundColor() const
Definition Graphics.h:584
void addWindowDestroyedCallback(WindowDestroyedCallback cb, void *userdata)
Definition Graphics.h:664
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 devi...
Definition Graphics.h:612
virtual void endShadowPass()=0
bool recordingEngine3D_
True while RenderSystem3D is submitting (AO / engine overlays).
Definition Graphics.h:980
virtual void setLighting2D(const Lighting2DUBO &ubo)=0
Upload per-frame / per-canvas 2D lighting constants for subsequent lit draws.
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 push(bool all)
Waterfall * newWaterfall()
Flowing waterfall (falling water sheet) with sky reflection, downward velocity streaks and animated f...
Definition Graphics.cpp:787
virtual Mesh * newMeshFromAssimp(const ::aiMesh &mesh)=0
GlobalIllumination * pipelineGlobalIllumination()
Definition Graphics.cpp:764
virtual void setMesh3DClusteredActive(bool active)=0
Cheap per-draw toggle for the already-uploaded clustered light table. Unlike setMesh3DClusteredLighti...
Shader * newGrassShader()
t3ssel8r-style grass billboard shader (alpha test + shadow two-tone). Owned by Graphics....
Definition Graphics.cpp:783
virtual Mesh * newMeshFromAssimp(const ::aiMesh &mesh, const aiMatrix4x4 &worldTransform)=0
Like newMeshFromAssimp, but bakes an Assimp node world transform into positions and transforms normal...
bool saveFramePng(const std::string &path)
Save the last presented frame to a PNG at path. Enables screen readback if needed....
Definition Graphics.cpp:828
Outline * newOutline()
Screen-space model outline (t3ssel8r-style) from GBuffer depth + normal. Caller owns Outline*; its Sh...
Definition Graphics.cpp:753
glm::vec2 inverseTransformPoint(glm::vec2 point)
virtual void begin3DFrameToCanvas(Canvas *canvas)=0
Open a 3D render pass targeting an offscreen Canvas (color + depth) at the canvas size....
glm::vec2 transformPoint(glm::vec2 point)
virtual void setMesh3DEnv(Texture *cube, float intensity)=0
Specular IBL environment for subsequent default mesh draws. cube must be from newCubemap (or nullptr ...
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 ren...
Definition Graphics.cpp:147
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 (ty...
virtual void drawMeshShadow(Mesh *mesh, const glm::mat4 &lightMVP)=0
virtual void renderScene3DToCanvas(Canvas *canvas, Camera3D *camera)
Definition Graphics.cpp:127
virtual Canvas * getCanvas() const =0
virtual void initWithWindow(void *nativeWindow)=0
Bind to an existing native window (SDL_Window*) and create Vulkan device/swapchain....
Shader * prepareSceneColorResolveShader(Texture *scene)
FXAA resolve shader that writes opaque RGB (ignores scene-color depth alpha).
Definition Graphics.cpp:131
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.
Mesh * newMeshCube(float size=1.f)
Procedural cube (edge length size, centered at origin, outward CCW for RH Y-up), with per-face normal...
Definition Graphics.cpp:790
virtual void popValidationScope()=0
void arc(std::string mode, std::string arcmode, float x, float y, float radius, float angle1, float angle2)
void rectangle(std::string mode, float x, float y, float w, float h, float rx, float ry)
virtual void drawTexturedRectRGBA(Texture *texture, float x, float y, float w, float h, float r, float g, float b, float a=1.f)
Definition Graphics.cpp:873
virtual void pushValidationScope()=0
Backend hooks so the platform-independent render3D() can wrap its work in a GPU validation error scop...
virtual void beginGBufferPass(int width, int height)=0
Depth/normal(/albedo) fill pass for mid/post effects. One-shot submit (like shadow); call before begi...
virtual void setMesh3DClusteredLighting(const ClusteredLightingUpload &upload)=0
Enable clustered forward path for subsequent default mesh draws (SSBO light lists)....
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)....
void rectangle(std::string mode, float x, float y, float w, float h)
Draws a rectangle.
void circle(std::string mode, float x, float y, float radius)
void clearPresentOverlay()
Drop the present overlay callback (window gone; re-register on UI init).
Definition Graphics.h:653
virtual Shader * newShader(const std::string &vertGlsl, const std::string &fragGlsl)=0
Compile GLSL source with glslc (must be on PATH). Empty vertGlsl → default textured vert....
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).
Definition Graphics.cpp:160
void origin()
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...
virtual Texture * newTexture(int width, int height, const uint8_t *rgba, bool repeatU=false, bool repeatV=false)=0
Outline * pipelineOutline()
Pipeline-owned Outline used by RenderSystem3D when the "outline" feature is on.
Definition Graphics.cpp:774
virtual bool reloadTextureFromFile(const std::string &filename)=0
Reload a path-cached texture from disk in place (pointer stable). False if unbound.
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 u...
Font * newFont(font::FontData *data, std::string charset=Font::defaultCharset())
Build a GPU font (glyph atlas texture) from decoded font data. Rasterizes charset (UTF-8,...
Definition Graphics.cpp:934
virtual void setMesh3DView(const glm::mat4 &view)=0
Camera view matrix for subsequent drawMesh (view-space depth / CSM select).
Material * newMaterial()
Create a Material asset (shading model + textures + PBR knobs). Caller owns Material*; not tracked by...
Definition Graphics.cpp:171
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...
AntiAliasing * newAntiAliasing()
Classic image-space AA (FXAA / SMAA / SSAA / NFAA). Caller owns AntiAliasing*; its Shaders are owned ...
Definition Graphics.cpp:779
const glm::mat4 & getProjection() const
Shader * newShader(const std::string &fragGlsl)
Definition Graphics.h:723
virtual Shader * newHairShaderFromSpv(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.
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 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): tra...
Texture * newTextureFromImageData(image::ImageData *data, bool repeatU=false, bool repeatV=false)
Definition Graphics.cpp:878
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,...
Definition Graphics.cpp:936
virtual void setMesh3DLight(const glm::vec3 &dir, const glm::vec3 &color)=0
Directional light for subsequent drawMesh calls (world-space direction toward surface).
virtual bool releaseShader(Shader *shader)
Eagerly releases a shader created by this Graphics.
Definition Graphics.h:768
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-occlusio...
virtual void setCanvas(Canvas *canvas)=0
nullptr or this → screen. Switching flushes pending draws to the previous target.
virtual bool isCanvasActive() const =0
virtual float getMaxAnisotropy() const =0
Device max supported anisotropy (1 if unsupported). Valid after initWithWindow.
std::unique_ptr< RenderControl > renderControl_
Definition Graphics.h:990
virtual void markSwapchainDirty()
Request swapchain recreation on next present/begin3DFrame.
Definition Graphics.h:624
void pop()
const glm::mat4 & getTransform() const
virtual Texture * newTextureFromFile(const std::string &filename)=0
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.
void scale(float x, float y=1.0f)
virtual Texture * newTexture(int width, int height, const uint8_t *rgba, const TextureCreateInfo &info)=0
virtual void present()=0
virtual void drawOcclusionSolid(float x, float y, float w, float h)
Definition Graphics.cpp:856
AntiAliasing * pipelineAntiAliasing()
Definition Graphics.cpp:769
void rotate(float r)
virtual void setMesh3DSceneDepth(Texture *depth)=0
Optional scene hardware depth (G-buffer hwDepth, Vulkan NDC z) bound to mesh3d shader binding 7....
AmbientOcclusion * pipelineAmbientOcclusion()
Pipeline-owned AO / GI / AA used by RenderSystem3D when features "ao" / "gi" / "aa" are enabled....
Definition Graphics.cpp:759
virtual void render3D()
Run RenderSystem3D (begin3DFrame + draw visible Renderable3D).
Definition Graphics.cpp:117
virtual bool bakeMeshMorph(Mesh *mesh)=0
If mesh morph weights are dirty, bake blended positions and upload to the GPU VBO....
virtual Shader * newShaderFromSpv(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 emp...
virtual void setMesh3DShadowReceive(bool receive)=0
Per-draw: when false, shadow sampling is forced off for the next mesh draw.
virtual bool supportsGBufferPost() const
Whether gbuffer-based post-process shaders (AO, GI) can be created on this backend....
Definition Graphics.h:104
Texture * newTextureFromFileRepeated(const std::string &filename, bool repeatU, bool repeatV)
Definition Graphics.cpp:893
virtual void begin3DFrame()=0
Begin a 3D frame: shadow/gbuffer (if pending) then a sampleable scene color pass (color+depth)....
ScreenSpaceReflection * newScreenSpaceReflection()
Screen-space reflections (ray-marched over scene color + hw depth). Caller owns ScreenSpaceReflection...
Definition Graphics.cpp:757
std::unique_ptr< GlobalIllumination > pipelineGI_
Definition Graphics.h:992
void points(const std::vector< glm::vec2 > &positions, const std::vector< Color > &colors)
Draws a series of points at the specified positions.
void requestSurfaceRecreate() override
Request recreation of the platform render surface on the next frame (Android background/foreground de...
Definition Graphics.h:631
std::unique_ptr< AmbientOcclusion > pipelineAO_
Definition Graphics.h:991
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...
void polygon(std::string mode, const std::vector< glm::vec2 > &vertices, bool skipLastFilledVertex=true)
Draws a polygon with an arbitrary number of vertices.
virtual void drawTexturedRect(Texture *texture, float x, float y, float w, float h, const Color &color)=0
void drawScene3D(float x, float y, float w, float h)
Script-friendly 4-arg form (simplesquirrel does not apply C++ defaults).
Definition Graphics.h:348
Shader * newShaderFromSpvFile(const std::string &fragPath)
Definition Graphics.h:714
virtual Texture * getSceneColorTexture()
Sampleable 3D color target for the current frame (RGB = lit, A = linear depth). Valid after begin3DFr...
Definition Graphics.h:432
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 drawSolidRectRGBA(float x, float y, float w, float h, float r, float g, float b, float a=1.f)
Definition Graphics.cpp:869
virtual void drawOcclusion(Drawable *drawable, const glm::mat4 &m)
Volumetric occlusion helpers (shadow-pass analogue for light shafts). drawOcclusion skips drawables w...
Definition Graphics.cpp:852
RenderControl * getRenderControl()
Shared compilable 3D render control (features → pass list + GBuffer). Owned by Graphics; valid for th...
Definition Graphics.cpp:173
virtual Mesh * newMeshFromArrays(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)....
virtual void clearScreen()
Script-friendly wrappers (r,g,b[,a] floats — no Color type in Squirrel).
Definition Graphics.cpp:865
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.
Water * newWater()
Dynamic water surface (sky reflection + animated edge waves + middle drop ripples)....
Definition Graphics.cpp:788
PresentOverlayFn presentOverlayFn_
Definition Graphics.h:985
Shader * newMeshShader(const std::string &fragGlsl)
Definition Graphics.h:741
virtual void end3DFrameToCanvas()=0
PresentOverlayFn getPresentOverlay() const
Definition Graphics.h:677
virtual Canvas * newCanvas(int width, int height)=0
Create an offscreen render target (sampleable). Owned by Graphics.
void(*)(void *userdata, void *commandBuffer) PresentOverlayFn
Optional overlay drawn inside the swapchain render pass (before end). Used by declarative UI (ImGui)....
Definition Graphics.h:672
virtual Shader * newMeshShaderFromWgsl(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 F...
virtual void setScreenReadbackEnabled(bool enabled)
When true, each present copies the swapchain to a CPU buffer for getPixel/newImageData....
Definition Graphics.h:591
virtual Mesh * newMeshSphere(int slices=32, int stacks=16)=0
Procedural UV sphere (radius 1, Y-up). Owned by Graphics. slices = longitude divisions,...
virtual Texture * newTexture(image::ImageData *data, const TextureCreateInfo &info)=0
Create texture from ImageData with sampler / mipmap options.
virtual void setViewportSize(int width, int height, int pixelwidth, int pixelheight)=0
Sets the current graphics display viewport dimensions.
GlobalIllumination * newGlobalIllumination()
Screen-space single-bounce GI. Caller owns GlobalIllumination*; its Shaders are owned by Graphics.
Definition Graphics.cpp:755
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 → treate...
void * getPresentOverlayUser() const
Definition Graphics.h:678
void setPresentOverlay(PresentOverlayFn fn, void *userdata)
Definition Graphics.h:673
void circle(std::string mode, float x, float y, float radius, int points)
Draws a circle using the specified arguments.
virtual Shader * newShaderFromSpvFile(const std::string &vertPath, const std::string &fragPath)=0
Load SPIR-V from files via Filesystem (empty vertPath → default textured vert).
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).
double getCurrentDPIScale() const
Definition Graphics.h:122
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 Texture * newCubemap(int faceSize, const uint8_t *rgbaFaces, const TextureCreateInfo &info)=0
Cubemap with mipmap / sampler options (IBL-friendly when generateMipmaps=true).
virtual void setMesh3DLighting(const Lighting3DPack &pack)=0
Per-frame ambient + up to 8 lights packed into Mesh3DUBO.
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,...
Dense grass + sparse dark tufts on a mesh. Caller owns GrassField*; GPU Mesh / Shader / Texture are o...
Definition Grass.h:124
2D immediate-mode drawing surface (screen or offscreen Canvas).
Definition IGraphics2D.h:32
3D frame / mesh / light / shadow rendering surface.
Definition IGraphics3D.h:28
Texture / mesh / shader / canvas creation and release.
Definition IResourceFactory.h:35
Packages shading method + surface parameters into one attachable asset.
Definition Material.h:26
Screen-space model outline (t3ssel8r-style), computed from the GBuffer hardware depth + world-normal ...
Definition Outline.h:31
Pixel-space sub-rectangle of a Texture (atlas cell / sprite frame). UV conversion uses the texture's ...
Definition Quad.h:9
Screen-space reflections (SSR) as a fullscreen post pass.
Definition ScreenSpaceReflection.h:26
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:17
Dynamic water surface with sky reflection and animated ripples.
Definition Water.h:33
Flowing waterfall (falling water sheet) rendered on a vertical plane.
Definition Waterfall.h:34
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition AnimTrail.h:6
glm::vec4 Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
CPU-built clustered lighting upload for one frame/camera. Point lights are clustered; directional lig...
Definition ClusteredLight.h:32
Per-pixel mesh entity-ID pass. Renders each EntityIdDraw's mesh with the given flat idColor (RGB enco...
Definition Graphics.h:441
Definition Light.h:20
Definition Light.h:90
Definition Shadow.h:25
Options for Graphics::newTexture / newCubemap. When generateMipmaps is true and sampler....
Definition TextureSampler.h:104
Sampler state for a Texture (filter, wrap, mip LOD, anisotropy). Defaults match historical engine beh...
Definition TextureSampler.h:27