#1
|
|||
|
|||
Adding lightmap and bumpmap
Hello,
I'm trying to add a light map and a bump map from 3ds Max into Vizard by using osgb. My light map is not displayed in vizard, but it is included as a texture. If i am using a complete map it is working, but then the resolution is not very good. Can anyone help me? Thanks in advance |
#2
|
|||
|
|||
What do you have set for the target map slot? Can you attach screenshots of the OSG export settings?
|
#3
|
|||
|
|||
The target map slot for my lighting map is self-illumination.
|
#4
|
|||
|
|||
Hi Stakkie,
To fully take advantage of shaders (to use the modern workflow diffuse/spec/normals/etc.) you'll want to be using the vizfx workflow. For this workflow, the lightmap should go in the Ambient slot. The Self-Illumination slot is currently used for glow maps. Check out this reference to see what is supported: http://docs.worldviz.com/vizard/Shaders_3DS_Max.htm For the programming side of things, the main difference is adding a model with vizfx.addChild('model.osgb') instead of using viz.add('model.osgb'). The old workflow is mainly useful when performance is considered more important than aesthetics, such as with unoptimized multi-million polygon architecture models. |
#5
|
|||
|
|||
Thanks for your comment, I'll try that!!
|
#6
|
|||
|
|||
Hi Veleno,
Now my diffuse color is not showed in vizard anymore. What am I doing wrong? I also added my Slate Material Editor printscreen of 3DS Max, maybe that gives a more clear view of what i did (wrong). Last edited by stakkie; 01-13-2017 at 12:23 PM. |
#7
|
|||
|
|||
Exposure Sample Script
Nothing wrong with your setup - your scene is just over exposed. The default exposure looks something like Diffuse * (Lightmap * 2), where lightmap values are interpreted on a 0 to 1 scale (e.g. 255 in photoshop reads as 1.0 to Vizard). This means that a neutral exposure is 50% gray.
As long as none of your brights are clipped in your lightmap you shouldn't need to rebake - exposure can be adjusted in Vizard by using a post process shader, like this: Code:
import viz import vizfx viz.go() vizfx.addChild('Exposure Test.OSGB') # Disable the default light (directional light attached to user viewpoint). # This should be done as soon as your scene has it's intended light added in. viz.MainView.getHeadLight().disable() # Import vizfx's post process functions, # then specifically grab the ones for color adjustment. import vizfx.postprocess from vizfx.postprocess.color import ExposureEffect # Create a new Exposure effect. In this case I'm darkening by 3 f-stops. # If you aren't familiar with camera terms, going down by one f-stop # halves the current brightness, while going up doubles it. effect = ExposureEffect(-3) # Add the effect to the post process manager vizfx.postprocess.addEffect(effect) # Important: set the pixel format to 32 bit. # This prevents banding after re-exposure and prevents bright whites from being clipped. # Exposure will not work as expected with overexposed scenes without this line. vizfx.postprocess.getEffectManager().setPixelFormat(viz.TEX_RGB_32) On a side note, lightmaps are treated as part of the lighting model in the vizfx shader so they are compatible with realtime lights. I've attached a sample file that adjusts the exposure on a test model, and you can learn more about Vizard's built in post-process shaders here: http://docs.worldviz.com/vizard/postprocess_color.htm Last edited by Veleno; 01-13-2017 at 01:56 PM. |
#8
|
|||
|
|||
Thanks!!! Now it looks very good
|
#9
|
|||
|
|||
No problem! Glad to help.
|
#10
|
|||
|
|||
Just two more questions.
What would be the workflow in 3ds max to get the right lightmaps? What would be the best way to change the brightness of the render-to-texture textures in 3ds max? I tried to view my model on the htc vive. But if the line Code:
vizfx.postprocess.getEffectManager().setPixelFormat(viz.TEX_RGB_32) Last edited by stakkie; 01-25-2017 at 09:02 AM. |
#11
|
|||
|
|||
> What would be the workflow in 3ds max to get the right lightmaps? What would be the best way to change the brightness of the render-to-texture textures in 3ds max?
The cleanest results come from rebaking, but that's way too slow for minor tweaks. First of all, here's our internal workflow when baking:
Prior to using shader based exposure controls, we'd do minor exposure tweaks in photoshop. We'd make a copy of the baked folder (usually called "bake_mod") to keep the originals intact and run the whole thing though a Photoshop batch process. Anything more than that and you get the same kinds of artifacts you get from trying to do major exposure changes in 8-bit. I'm going to look into the Vive problem and see if I can reproduce the issue.
Other notes: True GI is super slow to render cleanly, so most of the time I'll fake GI by setting VRayDirt as the intensity of a VRayAmbient Light and supplement it with appropriately placed point lights. If I'm planning to use realtime lights in the scene I'll also use the same approach to provide a base level of ambient light and. Last edited by Veleno; 01-25-2017 at 11:46 AM. |
#12
|
|||
|
|||
Bad news: I reproduced the problem and talked to our Vizard programmer and he believes that the Vive itself doesn't currently work with 32-bit, and at the time of this post there doesn't appear to be a quick one-line-of-code way to just briefly switch back to 8-bit just before sending the data to the headset.
8-bit exposure works, with the limitations stated above, but you may be stuck rebaking on this one. |
Tags |
bump map, exposure, light map, osgb, shader, vizard |
|
|