WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-03-2014, 02:03 AM
VR_user VR_user is offline
Member
 
Join Date: Jun 2012
Location: Vienna, Austria
Posts: 6
Question realtime calculated "reflection" & mirror transparency

Hello.

I am working on an optic effect similar to a reflection projected on an object.
The difference to a reflection is, that areas of the "mirror" that would "reflect" the scene background should instead be transparent.

For that purpose I created the attached test scene and script.

The result should be that when looking into the mirror like surface,
you should see the objects, with the wall in the background of the reflection.
Actually you see the whole scene reflected in the mirror and the wall is obscured.


Theoretically there are several ways to accomplish the desired effect.

The easiest would be to simply turn the background (viz.clearcolor()) transparent, but it seems like alpha isnt working ?
Alpha for clearcolor isnt documentated but it is recognized and used within viz.py.


I am looking into ways to achieve the desired optical effect.


Kind regards,
Sebastian
Attached Files
File Type: zip Demo_Optic.zip (4.0 KB, 664 views)
Reply With Quote
  #2  
Old 06-04-2014, 01:08 AM
VR_user VR_user is offline
Member
 
Join Date: Jun 2012
Location: Vienna, Austria
Posts: 6
An other option would be to Set the alpha of the mirror to transparent and place the mirror texture at decal appearance. Also the Background has to be excluded from beeing rendered to the mirror.

but it seems that .renderOnlyToRenderNodes([model]) isnt working correct and the background is still visible in the mirror ?
Reply With Quote
  #3  
Old 06-04-2014, 06:59 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,414
You could use <node3d:renderNode>.setClearColor to set the clear color to match the wall. If you don't want to render the floor you could exclude that using the <node3d:renderNode>.setCullMask command.
Reply With Quote
  #4  
Old 06-10-2014, 04:23 AM
VR_user VR_user is offline
Member
 
Join Date: Jun 2012
Location: Vienna, Austria
Posts: 6
Thanks for the information.

<node3d:renderNode>.setClearColor seems to support r,g,b,a
and overwrites the mirroring of viz.clearcolor r,g,b with also an additional alpha value

So the result is the one we were looking for.
Reply With Quote
Reply

Tags
alpha, mirror, reflection, transparent

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:32 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC