WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Changing a 3d scene from daytime to nighttime? (https://forum.worldviz.com/showthread.php?t=6006)

JohnSenior 04-28-2017 06:51 AM

Changing a 3d scene from daytime to nighttime?
 
Dear forum members,

I tried my best on my own, but i got to admit I am lost right now. I am trying to change a 3d scene (e.g. the "piazza") from daytime to nighttime. Is there a way to change the lighting accordingly just using Vizard? My basic idea was to turn off all existing lights an place a few new point lights in the locations of the streetlamps of "piazza". I tried to edit the lighting directly in the osgb.-file using Vizard inspector, but I was not able to turn off the light simulating the sunlight. Is it possible to make these changes within Vizard/Vizard Inspector, or do I have to use 3ds Max for this? Apologies, if these question are basic knowledge, but I couldnt find solutions online either.

Best,
John

Jeff 04-29-2017 01:05 AM

The piazza was created in 3ds Max with lighting baked into the model. One way to create a scene that has both day and night is to have two versions of the same model, each with it's own baked lighting.

To darken the piazza in Vizard you could try blending in a black texture as described here or use a post process effect:

Code:

import viz
viz.go()

piazza = viz.addChild('piazza.osgb')

import vizfx.postprocess
from vizfx.postprocess.color import ExposureEffect
effect = ExposureEffect(-2)
vizfx.postprocess.addEffect(effect)

There's a night version of the sky you could swap in as well:

Code:

piazza.visible(viz.OFF,node='pz_skydome-GEODE')
viz.addChild('sky_night.osgb')


Veleno 05-08-2017 01:23 PM

Hi John,

The lighting & shadows in the Piazza scene is baked into static maps, so it's not possible to relight it the way you're intending unless the lightmaps are removed. I checked the file in Inspector, and they're all on texture unit 1.

To get rid of them, you'd loop through all the objects in the scene with python and clear the texture unit. Jeff may be able to advise on that part.

Veleno 05-09-2017 11:20 AM

Hi again John,
I exported a version with all the lightmaps stripped out with realtime shadows coming from a directional light instead.

You can get that here: piazza_20170509_nolightmaps.zip (34mb)

Feel free to play around with it as you like!


JohnSenior 05-19-2017 03:06 AM

Wow, thats awesome, thanks so much, Veleno!


All times are GMT -7. The time now is 04:10 PM.

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