Example #1
0
 public void UpdatePerFrameData(bool updateGlobalTransform, bool updateLights, DeviceContextProxy deviceContext)
 {
     if (updateGlobalTransform)
     {
         globalTransform.View           = ViewMatrix;
         globalTransform.Projection     = ProjectionMatrix;
         globalTransform.ViewProjection = ViewMatrix * ProjectionMatrix;
         ScreenViewProjectionMatrix     = ViewMatrix * ProjectionMatrix * ViewportMatrix;
         cbuffer.UploadDataToBuffer(deviceContext, ref globalTransform);
     }
     if (updateLights)
     {
         LightScene.UploadToBuffer(deviceContext);
     }
 }
 public void UpdatePerFrameData(bool updateGlobalTransform, bool updateLights, DeviceContextProxy deviceContext)
 {
     if (updateGlobalTransform)
     {
         globalTransform.View           = ViewMatrix;
         globalTransform.Projection     = ProjectionMatrix;
         globalTransform.ViewProjection = ViewMatrix * ProjectionMatrix;
         ScreenViewProjectionMatrix     = ViewMatrix * ProjectionMatrix * ViewportMatrix;
         cbuffer.UploadDataToBuffer(deviceContext, ref globalTransform);
     }
     if (updateLights)
     {
         LightScene.LightModels.HasEnvironmentMap       = SharedResource.EnvironementMap != null;
         LightScene.LightModels.EnvironmentMapMipLevels = SharedResource.EnvironmentMapMipLevels;
         LightScene.UploadToBuffer(deviceContext);
     }
 }