|
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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) Code:
object.appearance(viz.DECAL) Code:
headlight = viz.get(viz.HEAD_LIGHT) headlight.intensity(2) |
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
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. |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
I tried disabling the lighting for the object but it did not work... The wall was still dim.
|
#7
|
|||
|
|||
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) |
Thread Tools | |
Display Modes | Rate This Thread |
|
|