simvx.graphics.types¶
Shared constants, numpy dtypes, and enums for SimVX Graphics.
Module Contents¶
Classes¶
Opaque handle to a registered GPU mesh. |
|
Viewport configuration for rendering. |
|
Material feature bitmask: matches shader #defines. |
|
Per-stream vertex data for one mesh (vertex stream split, D5). |
Data¶
API¶
- simvx.graphics.types.log¶
‘getLogger(…)’
- simvx.graphics.types.__all__¶
[‘Feature’, ‘MeshHandle’, ‘VertexStreams’, ‘Viewport’, ‘SHADING_DTYPE’, ‘EXTRAS_DTYPE’, ‘SKIN_DTYPE’…
- simvx.graphics.types.SHADER_DIR: pathlib.Path¶
‘Path(…)’
- simvx.graphics.types.UI_VERTEX_STRIDE¶
32
- simvx.graphics.types.ALPHA_OPAQUE: int¶
0
- simvx.graphics.types.ALPHA_BLEND: int¶
1
- simvx.graphics.types.ALPHA_CUTOFF: int¶
2
- simvx.graphics.types.MAX_TEXTURES¶
4096
- simvx.graphics.types.MAX_LIGHTS¶
1024
- simvx.graphics.types.MAX_OBJECTS¶
65536
- simvx.graphics.types.FRAMES_IN_FLIGHT¶
2
- class simvx.graphics.types.MeshHandle[source]¶
Bases:
typing.NamedTupleOpaque handle to a registered GPU mesh.
aabb_min/aabb_maxare the per-axis minimum/maximum of the mesh’s LOCAL vertex positions (each a length-3 float32 array). Computed from the same positions asbounding_radius; an empty mesh yields a zero-extent box at the origin. Both backends use identical semantics.- id: int¶
None
- vertex_count: int¶
None
- index_count: int¶
None
- bounding_radius: float¶
None
- aabb_min: numpy.ndarray¶
None
- aabb_max: numpy.ndarray¶
None
- class simvx.graphics.types.Viewport[source]¶
Viewport configuration for rendering.
- x: int¶
None
- y: int¶
None
- width: int¶
None
- height: int¶
None
- camera_view: numpy.ndarray¶
None
- camera_proj: numpy.ndarray¶
None
- render_target: Any | None¶
None
- class simvx.graphics.types.Feature[source]¶
Bases:
enum.IntFlagMaterial feature bitmask: matches shader #defines.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- NONE¶
0
- HAS_ALBEDO¶
None
- HAS_NORMAL¶
None
- HAS_METALLIC_ROUGHNESS¶
None
- HAS_EMISSIVE¶
None
- HAS_AO¶
None
- HAS_EMISSIVE_COLOR¶
None
- HAS_SCREEN_READ¶
None
- HAS_PLANAR_REFLECTION¶
None
- HAS_UV_TRANSFORM¶
None
- WETNESS_AFFECTED¶
None
- NO_DECALS¶
None
- __abs__()¶
- __add__()¶
- __and__()¶
- __bool__()¶
- __ceil__()¶
- __delattr__()¶
- __dir__()¶
- __divmod__()¶
- __eq__()¶
- __float__()¶
- __floor__()¶
- __floordiv__()¶
- __format__()¶
- __ge__()¶
- __getattribute__()¶
- __getnewargs__()¶
- __getstate__()¶
- __gt__()¶
- __hash__()¶
- __index__()¶
- __int__()¶
- __invert__()¶
- __le__()¶
- __lshift__()¶
- __lt__()¶
- __mod__()¶
- __mul__()¶
- __ne__()¶
- __neg__()¶
- __new__()¶
- __or__()¶
- __pos__()¶
- __pow__()¶
- __radd__()¶
- __rand__()¶
- __rdivmod__()¶
- __reduce__()¶
- __reduce_ex__()¶
- __repr__()¶
- __rfloordiv__()¶
- __rlshift__()¶
- __rmod__()¶
- __rmul__()¶
- __ror__()¶
- __round__()¶
- __rpow__()¶
- __rrshift__()¶
- __rshift__()¶
- __rsub__()¶
- __rtruediv__()¶
- __rxor__()¶
- __setattr__()¶
- __sizeof__()¶
- __str__()¶
- __sub__()¶
- __subclasshook__()¶
- __truediv__()¶
- __trunc__()¶
- __xor__()¶
- as_integer_ratio()¶
- bit_count()¶
- bit_length()¶
- conjugate()¶
- class denominator¶
- class imag¶
- is_integer()¶
- class numerator¶
- class real¶
- to_bytes()¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- __contains__(other)¶
- __iter__()¶
- __len__()¶
- simvx.graphics.types.SHADING_DTYPE¶
‘dtype(…)’
- simvx.graphics.types.EXTRAS_DTYPE¶
‘dtype(…)’
- simvx.graphics.types.SKIN_DTYPE¶
‘dtype(…)’
- class simvx.graphics.types.VertexStreams[source]¶
Bases:
typing.NamedTuplePer-stream vertex data for one mesh (vertex stream split, D5).
The canonical mesh payload flowing importer ->
SceneAdapter->MeshRegistry; each present stream uploads as its own GPU vertex buffer.extrasandskinareNonewhen the mesh has no such attributes (nothing is uploaded or bound for absent streams).- positions: numpy.ndarray¶
None
- shading: numpy.ndarray¶
None
- extras: numpy.ndarray | None¶
None
- skin: numpy.ndarray | None¶
None
- classmethod build(positions: numpy.ndarray, normals: numpy.ndarray | None = None, uvs: numpy.ndarray | None = None, *, tangents: numpy.ndarray | None = None, colours: numpy.ndarray | None = None, uvs2: numpy.ndarray | None = None, joints: numpy.ndarray | None = None, weights: numpy.ndarray | None = None) simvx.graphics.types.VertexStreams[source]¶
Assemble streams from per-attribute arrays.
Missing normals/uvs zero-fill the shading stream. The extras stream is built only when any of tangents/colours/uvs2 is given; absent fields default to zero tangent/uv2 and opaque white colour. Float colours in [0, 1] are converted to unorm8; uint8 colours pass through. The skin stream is built when joints AND weights are given (packing unchanged: uint16x4 joints + float32x4 weights).
- simvx.graphics.types.VERTEX_DTYPE¶
‘dtype(…)’
- simvx.graphics.types.TRANSFORM_DTYPE¶
‘dtype(…)’
- simvx.graphics.types.AABB_DTYPE¶
‘dtype(…)’
- simvx.graphics.types.MATERIAL_DTYPE¶
‘dtype(…)’
- simvx.graphics.types.INDIRECT_DRAW_DTYPE¶
‘dtype(…)’
- simvx.graphics.types.LIGHT_DTYPE¶
‘dtype(…)’
- simvx.graphics.types.SKINNED_VERTEX_DTYPE¶
‘dtype(…)’