WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

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

Hi,
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:

Code:
models['cooridor1'].visible(viz.OFF)
models['cooridor2'].visible(viz.OFF) 
models['cooridor3'].visible(viz.OFF)
models['cooridor4'].visible(viz.OFF)
and
Code:
models['cooridor1'].visible(viz.ON)
models['cooridor2'].visible(viz.ON) 
models['cooridor3'].visible(viz.ON)
models['cooridor4'].visible(viz.ON)
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:
Code:
models['cooridor1'].disable(viz.LIGHTING)
Thanks!
Reply With Quote
  #2  
Old 02-26-2016, 06:11 AM
makinate makinate is offline
Member
 
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
  #3  
Old 02-26-2016, 06:19 AM
makinate makinate is offline
Member
 
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
  #4  
Old 02-26-2016, 07:20 AM
makinate makinate is offline
Member
 
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
  #5  
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?

Code:
import viz
viz.go()

model = viz.addChild('corridor1.osgb')
model.visible(viz.OFF)
Can you post sample code that replicates the issue for you?
Reply With Quote
  #6  
Old 02-26-2016, 12:01 PM
makinate makinate is offline
Member
 
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_'):

Code:
#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 
models['t_node_l1r1'].visible(viz.OFF)
models['t_node_l1r0'].visible(viz.OFF) 
models['t_node_l0r1'].visible(viz.OFF)
models['t_node_l0r0'].visible(viz.OFF)  

# Turn on corridor according to conditions
if (cur_trial[0] == 1) and (cur_trial[1] == 1):
	models['t_node_l1r1'].visible(viz.ON)
	print 'all lights on'
elif (cur_trial[0] == 1) and (cur_trial[1] == 0):
	models['t_node_l1r0'].visible(viz.ON)
	print 'left lights on'
elif (cur_trial[0] == 0) and (cur_trial[1] == 1):
	models['t_node_l0r1'].visible(viz.ON)
        print 'right lights on'
elif (cur_trial[0] == 0) and (cur_trial[1] == 0):
	models['t_node_l0r0'].visible(viz.ON)
       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.

Thanks!
Reply With Quote
  #7  
Old 02-29-2016, 03:15 PM
JasmineJasmine JasmineJasmine is offline
Member
 
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
Reply

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