Beispiel #1
0
    private void BindQuadMaterial(IGameViewport viewport, PackedLinearColorA color, ITexture texture)
    {
        _device.SetMaterial(_quadMaterial);

        Shape3dGlobals globals;

        globals.viewProj = viewport.Camera.GetViewProj();
        globals.colors   = color.ToRGBA();

        _device.SetVertexShaderConstants(0, ref globals);

        _device.SetTexture(0, texture);
    }
Beispiel #2
0
    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);
    }