Map-Loader entfernt: glTF ist das einzige 3D-Format
engine/map.rs + render/brush.rs raus, Welt kommt komplett aus .glb. Spawn via Empty mit role=spawn statt info_player_start; testscene.glb (Boden, Wände, Spawn) ersetzt test.map. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+8
-10
@@ -1,9 +1,9 @@
|
||||
//! Szenen-Pass: zeichnet die 3D-Welt ins interne Target.
|
||||
//!
|
||||
//! Stand Schritt 5: Geometrie + Texturen kommen vom Aufrufer (Brush-Welt
|
||||
//! aus der `.map`, siehe render::brush; Bilder aus engine::tga). Pro Textur
|
||||
//! eine Bind-Group + ein Draw-Batch (Material-Batching „pro Textur ein
|
||||
//! Draw" wie im Plan). Die Shader (scene.wgsl) sind die echten PS1-Shader.
|
||||
//! Geometrie + Texturen kommen vom Aufrufer (Blender-Modelle via
|
||||
//! render::props; Bilder aus engine::tga). Pro Textur eine Bind-Group +
|
||||
//! ein Draw-Batch (Material-Batching „pro Textur ein Draw" wie im Plan).
|
||||
//! Die Shader (scene.wgsl) sind die echten PS1-Shader.
|
||||
|
||||
use wgpu::util::DeviceExt;
|
||||
|
||||
@@ -28,6 +28,7 @@ pub(crate) struct Batch {
|
||||
|
||||
/// CPU-seitige Welt-Geometrie, fertig zum Hochladen. Die Indizes sind nach
|
||||
/// Textur gruppiert; `batches` zeigt in diese Reihenfolge.
|
||||
#[derive(Default)]
|
||||
pub(crate) struct Mesh {
|
||||
pub(crate) verts: Vec<Vertex>,
|
||||
pub(crate) indices: Vec<u32>,
|
||||
@@ -107,12 +108,9 @@ impl ScenePass {
|
||||
compilation_options: Default::default(),
|
||||
targets: &[Some(color_format.into())],
|
||||
}),
|
||||
// Back-face Culling: Brush-Polygone werden CCW um ihre nach
|
||||
// außen zeigende Normale gewickelt (siehe render::brush), und
|
||||
// die Z-up→Y-up-Drehung erhält die Orientierung (det +1). Also
|
||||
// sind die Außenflächen front-facing — Rückseiten und alle
|
||||
// verdeckten Innenflächen zwischen Brushes fallen weg.
|
||||
// (Front-Face bleibt der wgpu-Default CCW.)
|
||||
// Back-face Culling: glTF-Dreiecke sind CCW von außen
|
||||
// gewickelt — die Außenflächen sind front-facing, Rückseiten
|
||||
// fallen weg. (Front-Face bleibt der wgpu-Default CCW.)
|
||||
primitive: wgpu::PrimitiveState {
|
||||
cull_mode: Some(wgpu::Face::Back),
|
||||
..Default::default()
|
||||
|
||||
Reference in New Issue
Block a user