#1
|
|||
|
|||
Vizard 2.0x lighting
As I mentioned in another thread, we aim for "WYSIWYG" lighting; that was, we need to precompute the RGBs on our textures and then just have them appear identically when viewed within Vizard.
One of the first things I noticed with Viz 2.07 is that something is clearly different with the default texture filtering (which I must say I really like). However, is it safe to say that the default lighting has changed too? I bring this up because some of the textures in our world exhibit different behavior when I view them with v1.98 and v2.07 respectively. For instance, we have a transparent "grate" texture on the floor in one of our virtual worlds, covering up a virtual "pit." In v2.07, when you view the grate orthogonally, the grays that make up the grate are clearly much brighter than when you view the grate at a sharper angle. In v1.98, the pixels that make up the grate appear to be constant, regardless of view angle. There wasn't any mention of possible lighting changes in the documentation that I saw; can I get the scoop here? Last edited by FlyingWren; 08-10-2003 at 06:35 PM. |
#2
|
|||
|
|||
Hi,
There is one significant lighting change in the newer version that you should be aware of. In the old version the default lighting was pointed in a fixed direction. In the newer version the default light is fixed to the head, so it is always pointing in the direction of the view. Since transparent textures are modulated, the color depends on the angle at which the light is hitting it, hence the change in color at the different viewing angles. If you want the grate to always be the same color simply disable lighting on it. Code:
grate = viz.add('grate.wrl') grate.disable(viz.LIGHTING) |
#3
|
|||
|
|||
Ah. Yep, that does the trick. As always, thanks for your quick and helpful response.
If I could pester you with one more question re: the depth-of-field effect that is in Vizard 2.07... It appears that textures beyond certain distance thresholds appear 'blurred' to various amounts. I assume this is done through mipmapping. Anyway, if we should want to disable it, what's the command? I tried room = viz.add('room.wrl') room.appearance(viz.DECAL) ...and some derivations thereof, but didn't get what I was looking for |
#4
|
|||
|
|||
Hi,
In the latest version you can control the filter mode of textures. So in your case you would do something like this: Code:
tex = viz.add('texture.jpg') tex.filter(viz.MIN_FILTER,viz.NEAREST) tex.filter(viz.MAG_FILTER,viz.NEAREST) object.texture(tex) |
#5
|
|||
|
|||
Oh, wow. Thanks a bunch.
Edit: Just tried it out and it is working just fine. Thanks again. Last edited by FlyingWren; 08-13-2003 at 01:44 PM. |
|
|