WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 02-25-2016, 03:58 PM
makinate makinate is offline
Join Date: Dec 2014
Posts: 10
switch off self-illuminating effects of baked textures

How do I switch off the self-illumination of a texture?

I created four corridor models in 3ds max. The corridors only differ in lighting conditions, i.e., each corridor has lighter and darker sections but apart from that they are all the same.
I baked the textures in 3ds max and exported each model to OSGB format. I did not export the lights. The exports look fine in the Vizard Inspector.

I then load the models in Vizard. They are all located in the same coordinates with the same orientation. I switch visibility on and off according to how I need, using:

The models become visible or invisible just fine. However, the self illuminating effects from the models are not being switched off when a model becomes invisible. How do I switch them off?

This did not do the trick:
Reply With Quote
Old 02-26-2016, 06:11 AM
makinate makinate is offline
Join Date: Dec 2014
Posts: 10
additional information

things I have tried that did not work:
  1. models['cooridor1'].disable(viz.RENDERING)
  2. models['cooridor1'].visible(viz.OFF)
  3. I also tried moving the models to a different position when they are not visible.
  4. There are no lights in the scene (I exported the baked scene from 3ds max without the lights). Exporting with lights did make a difference though

Thanks again! Happy for any idea or advice.
Reply With Quote
Old 02-26-2016, 06:19 AM
makinate makinate is offline
Join Date: Dec 2014
Posts: 10
Quick update:

The models use the same naming conventions (for nodes and textures). It appears that the textures of whichever corridor is loaded first are applied to all other corridors. Any suggestions to change that without having to rename all nodes and texture names in 3ds max?
Reply With Quote
Old 02-26-2016, 07:20 AM
makinate makinate is offline
Join Date: Dec 2014
Posts: 10
Quick update:

Placing all models in unique folders and exporting the textures to a subfolder did not help.

I am using Vizard 5.
Reply With Quote
Old 02-26-2016, 09:08 AM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,466
If you load one of the corridor models and turn off it's visibility is the scene dark?

import viz

model = viz.addChild('corridor1.osgb')
Can you post sample code that replicates the issue for you?
Reply With Quote
Old 02-26-2016, 12:01 PM
makinate makinate is offline
Join Date: Dec 2014
Posts: 10
Hi Jeff,
Thanks, yes the scene is dark when I turn off the models' visibility. I figured out that it was indeed an issue with the textures. Here are some code snippets (note that I changed the names of the corridors to 't_node_'):

#load the corridor models
models['t_node_l0r0'] = viz.add('Models/T_node_l0r0/T_node_l0r0.OSGB')
models['t_node_l1r0'] = viz.add('Models/T_node_l1r0/T_node_l1r0.OSGB')
models['t_node_l0r1'] = viz.add('Models/T_node_l0r1/T_node_l0r1.OSGB')
models['t_node_l1r1'] = viz.add('Models/T_node_l1r1/T_node_l1r1.OSGB')

#switch off visibility 

# Turn on corridor according to conditions
if (cur_trial[0] == 1) and (cur_trial[1] == 1):
	print 'all lights on'
elif (cur_trial[0] == 1) and (cur_trial[1] == 0):
	print 'left lights on'
elif (cur_trial[0] == 0) and (cur_trial[1] == 1):
        print 'right lights on'
elif (cur_trial[0] == 0) and (cur_trial[1] == 0):
       print 'all lights off'
I found a workaround to the problem. I gave every texture a unique name before baking in 3ds max which solved the issue. This is quite tedious though, especially when there are a lot of textures.
If I don't rename the textures, all 4 corridors will have identical textures (the texture of the model that is being loaded first). Each model is saved in a separate folder and contains a subfolder with the textures.

Reply With Quote
Old 02-29-2016, 03:15 PM
JasmineJasmine JasmineJasmine is offline
Join Date: Feb 2016
Posts: 6
I've just done something similar. A model I made in Max should be exported for use in another program. Most of my materials we're build procedurally and therefore I needed to turn them into bitmaps, without baking any light information. I simply used the "Render Map" function. In the material editor (compact) you go down to the map level, right click in the material slot and select "Render Map". Now you specify the output name, destination, file type and size, and then the map is rendered. Pure 2D.
Hope it helps.
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
OSG IVE export 3dmax with baked textures chris_user Vizard 2 04-12-2011 10:33 PM
Multiple Textures for Diffuse and Specularity Shader Issue shivanangel Vizard 1 05-11-2009 10:44 AM

All times are GMT -7. The time now is 01:08 AM.

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