WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-14-2004, 08:47 AM
murm murm is offline
Member
 
Join Date: Nov 2003
Location: Austin, TX
Posts: 1
Send a message via AIM to murm Send a message via Yahoo to murm
Question Problems with lighting in 2.0

Hello-

I am still having a couple problems with lighting in Vizard 2.0. First, my objects are very dark and difficult to see. I have tried using .disable(viz.LIGHTING) but that does not fix the problem.

Second, I have added fog to my environment and it looks like a black hole rather than bright white fog. I suspect this problem is related to the general lighting problem...

Does anyone know how to fix these two problems? Thank you for your help!

-Matt
Reply With Quote
  #2  
Old 04-14-2004, 09:35 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Matt,

I believe the default fog color is black. Have you tried changing it to some other color? For example to change the fog color to a light gray you would do the following:
Code:
viz.fogcolor(0.7,0.7,0.7)
Do your objects that appear dark have textures on them? If they have textures try doing the following:
Code:
object.appearance(viz.DECAL)
If your objects don't have textures then disabling lighting on them should fix it. You might want to try increasing the intensity of the head light:
Code:
headlight = viz.get(viz.HEAD_LIGHT)
headlight.intensity(2)
Let me know if you are still experiencing this problem and I'll try to take a look at the model.
Reply With Quote
  #3  
Old 04-15-2004, 03:53 PM
mspusch mspusch is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 223
Just two more thoughts:

a) are you using an ATI graphics card? Which?
b) can you try loading untextured models (like Start - Programs - Vizard20 - 3D Models - 3D Text) into Vizard to see if this is a problem about textures or about lighting?

Thanks,

Matthias
Reply With Quote
  #4  
Old 04-20-2004, 02:03 PM
david david is offline
Member
 
Join Date: Mar 2003
Posts: 23
conflict with transparent textures and non transparent textures

As a follow up, I have lighting pbs when I switch textures on an object. Basically, when I switch textures on a self-illuminated object, the object stays as bright as originally, as long as all the textures are non-transparent.
However if I use a transparent texture it seems to mess up the flag for .appearance. As a result if I go back to a non-transparent texture, and if the object is on the side (not in the head light range), it appears darker than originally. So I need to set the flag for .appearance to viz.DECAL. And then if I try to reapply a transparent texture, the transparency is not rendered anymore so I need to set the flag to viz.MODULATE to get the transparency back. It is a little bit of a hassle, but in my case I could track easily the transparency of the texture.
Reply With Quote
  #5  
Old 04-20-2004, 02:28 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi David,

On a side note, you could disable lighting on your object and it should be as bright as possible no matter which texture is applied. The reason your object becomes dim when you apply the transparent texture is because the MODULATE flag must be set in order for transparent textures to appear transparent. However, vizard does not automatically set the DECAL flag when you apply a non-transparent texture, that is why you must do it manually.
Reply With Quote
  #6  
Old 04-20-2004, 09:01 PM
david david is offline
Member
 
Join Date: Mar 2003
Posts: 23
I tried disabling the lighting for the object but it did not work... The wall was still dim.
Reply With Quote
  #7  
Old 04-21-2004, 09:59 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi David,

Could you try the following script? Replace tree.png with any of your transparent textures. When you run the script it should display the texture spinning in front of you. Press the spacebar to toggle between enabling/disabling lighting. At first the texture should be dim, but when you disable lighting it should always be lit. Let me know if this is not the case.
Code:
import viz
viz.go()
quad = viz.add(viz.TEXQUAD)
quad.translate(0,1.6,3)
quad.spin(0,1,0,90)
quad.texture(viz.add('tree.png'))
quad.lit = 1
def mykey(key):
	if key == ' ':
		quad.lit = not quad.lit
		if quad.lit:
			quad.enable(viz.LIGHTING)
		else:
			quad.disable(viz.LIGHTING)
viz.callback(viz.KEYBOARD_EVENT,mykey)
Thanks!
Reply With Quote
Reply


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 10:22 AM.


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