예제 #1
0
 public void SetConstants(VertexConstantData constants)
 {
     m_vertexBatchConstantBuffer.Write(constants);
 }
예제 #2
0
        /// <summary>
        /// Creates constant data for our shaders
        /// </summary>
        /// <returns></returns>
        private VertexConstantData GetConstantData()
        {
            var constantData = new VertexConstantData();

            /* Our shader needs to know the viewport size to 
             * properly render.  This is how we do that */
            var viewPort = m_device.Rasterizer.GetViewports()[0];

            constantData.ViewportSize.X = viewPort.Width;
            constantData.ViewportSize.Y = viewPort.Height;

            return constantData;
        }