private void BindLineMaterial(IGameViewport viewport, PackedLinearColorA color, bool occludedOnly = false) { if (occludedOnly) { _device.SetMaterial(_lineOccludedMaterial); } else { _device.SetMaterial(_lineMaterial); } Shape3dGlobals globals; globals.viewProj = viewport.Camera.GetViewProj(); globals.colors = color.ToRGBA(); _device.SetVertexShaderConstants(0, ref globals); }
public override void Render(IGameViewport viewport, PartSysEmitter emitter) { if (!GetEmitterWorldMatrix(viewport, emitter, out var worldMatrix)) { return; } _device.SetVertexShaderConstants(0, ref worldMatrix); _device.SetIndexBuffer(_indexBuffer); RenderParticles(emitter); }
public void Render(IGameViewport viewport, TileRect tileRect) { _device.SetMaterial(_material.Resource); var viewProj = viewport.Camera.GetViewProj(); _device.SetVertexShaderConstants(0, ref viewProj); using var sectorIt = new SectorIterator(tileRect); foreach (var sector in sectorIt.EnumerateSectors()) { if (!sector.IsValid) { continue; } if (!_sectorDebugState.TryGetValue(sector.Loc, out var renderingState)) { renderingState = BuildSubTileMesh(_device, _material.Resource.VertexShader, sector.Sector); _sectorDebugState.Add(sector.Loc, renderingState); } renderingState.Render(_device); } }