WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-04-2007, 01:32 AM
k_iwan k_iwan is offline
Member
 
Join Date: May 2006
Posts: 115
Unhappy Sky blending...?? suggestions?

Hi

I was just trying out a transitioning sky from morning to noon skybox, and apparently, the blending texture method does not work for skybox.

################################################## #
import viz

morningSky = viz.add(viz.ENVIRONMENT_MAP,'morning/morning.jpg')
noonSky = viz.add(viz.ENVIRONMENT_MAP,'noon/noon.jpg')
eveningSky = viz.add(viz.ENVIRONMENT_MAP,'evening/evening.jpg')
nightSky = viz.add(viz.ENVIRONMENT_MAP,'night/night.jpg')

skyDome = viz.add('skydome.dlc')
skyDome.texture(morningSky)
skyDome.texture(noonSky,'',1)
#skyDome.texture(eveningSky,'',2)
#skyDome.texture(nightSky,'',3)

blend = viz.add('multitexblend.fp')
skyDome.apply(blend)

blend.param(0,0)

slider = viz.add(viz.SLIDER)
slider.translate(0.5,0.1)


def myslider(obj,pos):
if obj == slider:
blend.param(0,pos)

viz.callback(viz.SLIDER_EVENT,myslider)

viz.go()
################################################## #

When I run it, all i get is black. If I take out the blending part, I can see my skies. So, I guess the only alternative is by generating a 360 panoramic images and apply it on a polygon sphere? Any suggestions? Did I do something wrong?

Kind Regards,
Iwan
Reply With Quote
  #2  
Old 06-04-2007, 09:46 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The fragment program you are using was made for 2D textures, it will not work with cubemap textures. You can use the node.texblend command to get the blending to work. Here is a sample script:
Code:
import viz
viz.go()

dome = viz.add('skydome.dlc')

tex1 = viz.add(viz.ENVIRONMENT_MAP,'sky.jpg')
tex2 = viz.add(viz.ENVIRONMENT_MAP,'townhall_L.jpg')

dome.texture(tex1)
dome.texture(tex2,unit=1)
dome.texblend(0,unit=1)

slider = viz.addSlider(pos=(0.5,0.1,0))

vizact.onslider(slider,dome.texblend,unit=1)
Reply With Quote
  #3  
Old 06-05-2007, 04:31 AM
k_iwan k_iwan is offline
Member
 
Join Date: May 2006
Posts: 115
Talking Thank you for the Explanation!

Hi,

Thank you for the clarification! .texblend works like a charm!
I just need to add time and datetime python module and... ... I will have a nice working "virtual-sky"

Thank you for pointing me in the right direction!

Kind Regards,
Iwan
Reply With Quote
Reply

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 05:15 PM.


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