def _ManualInit(self, name = 'SceneRenderJobSpace'):
     SceneRenderJobSpace._ManualInit(self, name)
     self.persistedPostProcess = {}
     self.settings = {'aaQuality': 3,
      'postProcessingQuality': 2,
      'shadowQuality': 2,
      'shadowMapSize': 1024,
      'hdrEnabled': True}
     self.backBufferOverride = None
     self.depthBufferOverride = None
Example #2
0
 def _ManualInit(self, name='SceneRenderJobSpace'):
     SceneRenderJobSpace._ManualInit(self, name)
     self.persistedPostProcess = {}
     self.settings = {
         'aaQuality': 3,
         'postProcessingQuality': 2,
         'shadowQuality': 2,
         'shadowMapSize': 1024,
         'hdrEnabled': True
     }
     self.backBufferOverride = None
     self.depthBufferOverride = None
 def _ManualInit(self, name):
     self.stencilBlitEffect = None
     self.stencilPath = ''
     self.SetupStencilBlitEffect()
     self.isOffscreen = False
     self.doFinalBlit = True
     self.offscreenRenderTarget = None
     self.offscreenDepthStencil = None
     self.finalTexture = None
     self.rtWidth = 0
     self.rtHeight = 0
     self.blitViewport = trinity.TriViewport()
     SceneRenderJobSpace._ManualInit(self, name)
Example #4
0
 def _ManualInit(self, name):
     self.stencilBlitEffect = None
     self.stencilPath = ""
     self.SetupStencilBlitEffect()
     self.isOffscreen = False
     self.doFinalBlit = True
     self.offscreenRenderTarget = None
     self.offscreenDepthStencil = None
     self.finalTexture = None
     self.rtWidth = 0
     self.rtHeight = 0
     self.blitViewport = trinity.TriViewport()
     SceneRenderJobSpace._ManualInit(self, name)
 def _CreateRenderTargets(self):
     if not self.prepared:
         return
     SceneRenderJobSpace._CreateRenderTargets(self)
     vp = self.GetViewport()
     self.rtWidth = vp.width
     self.rtHeight = vp.height
     if self.customBackBuffer is None:
         self.offscreenRenderTarget = trinity.Tr2RenderTarget(vp.width, vp.height, 1, self.bbFormat)
         self.finalTexture = self.offscreenRenderTarget
     else:
         self.finalTexture = trinity.Tr2RenderTarget(vp.width, vp.height, 1, self.customBackBuffer.format)
     if self.customDepthStencil is None:
         self.offscreenDepthStencil = trinity.Tr2DepthStencil(vp.width, vp.height, trinity.DEPTH_STENCIL_FORMAT.AUTO)
     self.finalTexture.name = 'finalTexture'
Example #6
0
 def _CreateRenderTargets(self):
     if not self.prepared:
         return
     SceneRenderJobSpace._CreateRenderTargets(self)
     vp = self.GetViewport()
     self.rtWidth = vp.width
     self.rtHeight = vp.height
     if self.customBackBuffer is None:
         self.offscreenRenderTarget = trinity.Tr2RenderTarget(vp.width, vp.height, 1, self.bbFormat)
         self.finalTexture = self.offscreenRenderTarget
     else:
         self.finalTexture = trinity.Tr2RenderTarget(vp.width, vp.height, 1, self.customBackBuffer.format)
     if self.customDepthStencil is None:
         self.offscreenDepthStencil = trinity.Tr2DepthStencil(vp.width, vp.height, trinity.DEPTH_STENCIL_FORMAT.AUTO)
     self.finalTexture.name = "finalTexture"
Example #7
0
 def SetRenderTargets(self, *args):
     SceneRenderJobSpace.SetRenderTargets(self, *args)
     if self.depthBufferOverride:
         self.AddStep(
             'SET_SWAPCHAIN_DEPTH',
             trinity.TriStepSetDepthStencil(self.depthBufferOverride))
     if self.backBufferOverride:
         self.AddStep(
             'SET_SWAPCHAIN_RT',
             trinity.TriStepSetRenderTarget(self.backBufferOverride))
 def SetRenderTargets(self, *args):
     SceneRenderJobSpace.SetRenderTargets(self, *args)
     self.RemoveStep('PUSH_RENDER_TARGET')
     self.RemoveStep('PUSH_DEPTH_STENCIL')
     self.RemoveStep('POP_RENDER_TARGET')
     self.RemoveStep('POP_DEPTH_STENCIL')
     self.RemoveStep('SET_BLIT_VIEWPORT')
     self.RemoveStep('COPY_TO_BLIT_TEXTURE')
     self.RemoveStep('FINAL_BLIT_EMBEDDED')
     self.RemoveStep('PUSH_BLIT_DEPTH')
     self.RemoveStep('POP_BLIT_DEPTH')
     viewport = self.GetViewport()
     if viewport is not None:
         vpStep = self.GetStep('SET_VIEWPORT')
         if vpStep is not None:
             vpOrigin = trinity.TriViewport(0, 0, viewport.width, viewport.height)
             vpStep.viewport = vpOrigin
     if self.offscreenDepthStencil:
         self.AddStep('PUSH_DEPTH_STENCIL', trinity.TriStepPushDepthStencil(self.offscreenDepthStencil))
         self.AddStep('POP_DEPTH_STENCIL', trinity.TriStepPopDepthStencil())
     if self.offscreenRenderTarget:
         self.AddStep('PUSH_RENDER_TARGET', trinity.TriStepPushRenderTarget(self.offscreenRenderTarget))
         self.AddStep('POP_RENDER_TARGET', trinity.TriStepPopRenderTarget())
     self.AddStep('PUSH_BLIT_DEPTH', trinity.TriStepPushDepthStencil(None))
     self.RemoveStep('FINAL_BLIT')
     if self.customBackBuffer is not None and self.finalTexture is not None:
         step = trinity.TriStepResolve(self.finalTexture, self.customBackBuffer)
         step.name = 'Resolve: finalTexture <== customBackBuffer'
         self.AddStep('COPY_TO_BLIT_TEXTURE', step)
     if self.doFinalBlit:
         self.AddStep('SET_BLIT_VIEWPORT', trinity.TriStepSetViewport(viewport))
         if self.finalTexture:
             if self.stencilPath is None or self.stencilPath == '':
                 self.AddStep('FINAL_BLIT_EMBEDDED', trinity.TriStepRenderTexture(self.finalTexture))
             else:
                 stencilTriTextureRes = trinity.TriTextureRes()
                 stencilTriTextureRes.SetFromRenderTarget(self.finalTexture)
                 self.blitMapParameter.SetResource(stencilTriTextureRes)
                 self.AddStep('FINAL_BLIT_EMBEDDED', trinity.TriStepRenderEffect(self.stencilBlitEffect))
     self.AddStep('POP_BLIT_DEPTH', trinity.TriStepPopDepthStencil())
Example #9
0
 def _GetRTForDepthPass(self):
     if self.backBufferOverride is not None:
         return self.backBufferOverride
     return SceneRenderJobSpace._GetRTForDepthPass(self)
Example #10
0
 def GetBackBufferSize(self):
     if self.backBufferOverride is None:
         return SceneRenderJobSpace.GetBackBufferSize(self)
     width = self.backBufferOverride.width
     height = self.backBufferOverride.height
     return (width, height)
 def _SetSettingsBasedOnPerformancePreferences(self):
     SceneRenderJobSpace._SetSettingsBasedOnPerformancePreferences(self)
     self.usePostProcessing = False
     self.distortionEffectsEnabled = False
 def _GetSettings(self):
     currentSettings = SceneRenderJobSpace._GetSettings(self)
     currentSettings['postProcessingQuality'] = 0
     return currentSettings
Example #13
0
 def _GetRTForDepthPass(self):
     if self.finalTexture is not None:
         return self.finalTexture
     return SceneRenderJobSpace._GetRTForDepthPass(self)
 def _GetRTForDepthPass(self):
     if self.finalTexture is not None:
         return self.finalTexture
     return SceneRenderJobSpace._GetRTForDepthPass(self)
Example #15
0
 def _SetSettingsBasedOnPerformancePreferences(self):
     SceneRenderJobSpace._SetSettingsBasedOnPerformancePreferences(self)
     self.usePostProcessing = False
     self.distortionEffectsEnabled = False
Example #16
0
 def _GetSettings(self):
     currentSettings = SceneRenderJobSpace._GetSettings(self)
     currentSettings["postProcessingQuality"] = 0
     return currentSettings
 def _GetRTForDepthPass(self):
     if self.backBufferOverride is not None:
         return self.backBufferOverride
     return SceneRenderJobSpace._GetRTForDepthPass(self)
 def DoReleaseResources(self, level):
     self.finalTexture = None
     self.offscreenRenderTarget = None
     self.offscreenDepthStencil = None
     self.blitMapParameter.SetResource(None)
     SceneRenderJobSpace.DoReleaseResources(self, level)