Antialiasing not working when using vrInteraction > prerender for older VRED versions

Antialiasing not working when using vrInteraction > prerender for older VRED versions

cgY6PC8
Participant Participant
433 Views
1 Reply
Message 1 of 2

Antialiasing not working when using vrInteraction > prerender for older VRED versions

cgY6PC8
Participant
Participant

Hey there,

 

I'm working on a plugin that should keep the camera height at a specified level when enabled. This works fine and I use the following code to do this:

 

class RenderAction(vrInteraction):
    def __init__(self):
        vrInteraction.__init__(self)
        self.addRender()

    def preRender(self):
        cameraTransform = vrCameraService.getActiveCamera().getOrCreateTransformNode()
        cameraTranslation = cameraTransform.getWorldTranslation()
        cameraTranslation.setZ(2000)
        cameraTransform.setWorldTranslation(cameraTranslation)

renderaction = RenderAction()

 

Unfortunatelly my client is forced to work with older versions (< 15.0) of VRED on some machines. In this versions there is a bug, which results in Anti Aliasing not working when using the approach above. Anti-Aliasing is working fine in the latest release (15.3).

 

Is there a workaround or another approach how I can achive this?

 

Thanks,

Christopher

0 Likes
Accepted solutions (1)
434 Views
1 Reply
Reply (1)
Message 2 of 2

cgY6PC8
Participant
Participant
Accepted solution

Got it to work!

 

The problem was in the way I adjusted the camera. When the camera is adjusted in every render update the Anti Aliasing will block in Versions before 15.3. But there is a really simple workaround:

 

class RenderAction(vrInteraction):
    def __init__(self):
        vrInteraction.__init__(self)
        self.addRender()
        
        self.cameraHeight = 2000

    def preRender(self):
        cameraTransform = vrCameraService.getActiveCamera().getOrCreateTransformNode()
        cameraTranslation = cameraTransform.getWorldTranslation()

        # Limit camera updates to times when the camera does not move
        if abs(cameraTranslation.z() - self.cameraHeight) > 10:
            cameraTranslation.setZ(self.cameraHeight)
            cameraTransform.setWorldTranslation(cameraTranslation)

renderaction = RenderAction()

 

 

 

 

0 Likes