WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-24-2013, 01:28 PM
whaleeee whaleeee is offline
Member
 
Join Date: Feb 2013
Posts: 5
Setting up render node for shadowing

I'm trying to use a render texture which will be used in a shader to produce shadows from a single directional light. I set up my directional light as follows:

Code:
# Directional Light
dLight = viz.addLight()
dLight.setEuler(0,45,0)
I then used the code from the third post in this thread to set up my render node and render texture and display it on the screen. Then to fix the position of the render node my code looks like this:

Code:
# add render texture
[width,height] = viz.MainWindow.getSize(viz.WINDOW_PIXELS)
depth = viz.addRenderTexture(size=[width,height],format=viz.TEX_DEPTH)

# add render node
rn = viz.addRenderNode(size=[width,height])
rn.setInheritView(False)
rn.setRenderTexture(depth)

# add render point
renderPoint = viz.addGroup()
renderPoint.setPosition(0,5,-5)
renderPoint.setEuler(0,45,0)

# link the render point and render node
renderLink = viz.link(renderPoint,rn)
This seems to work, and I have the depth texture displayed on a texQuad on my screen. I have two questions to start with:

1. The line:
Code:
renderPoint.setPosition(0,5,-5)
is kind of puzzling to me, and in fact I just put it in as a quick fix so that the render node was located somewhere along the light vectors. My question is where exactly should I put the render point? Logically it would be at the source of the light, but since it is a directional light it is infinitely far away.

2. Does anyone have any tutorials or resources on how to do shadowing using a depth texture in Vizard? I've found several tutorials but they all use GLUT and newer versions of OpenGL.

Thanks
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to render a texture of the transparent object and then blur it whj Vizard 1 09-25-2012 03:15 PM
To Masaki regarding render nodes surf3rguy Vizard 1 04-17-2012 05:37 PM
re: render nodes and scenes nige777 Vizard 2 10-18-2010 01:14 PM
How to apply shader and render texture to an object whj Vizard 0 04-23-2010 12:23 PM
Documentation for coding a new render node? reedev Plug-in development 2 10-30-2008 10:06 AM


All times are GMT -7. The time now is 01:53 AM.


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