WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-15-2012, 08:14 AM
EnvisMJ EnvisMJ is offline
Member
 
Join Date: May 2009
Location: Purdue University, West Lafayette, Indiana
Posts: 44
Emissive object blackout?

We're having a problem with emissive in our cave.

We're using an intersense wand to indicate an item on 'mouse over' to turn on emissive for it.

object.emissive([0.5,0.5,0.5])

Then, when you 'mouse over' another object the first object is supposed to return to it's original state, and the new object is supposed to become emissive.

object.emissive([0,0,0])

It works fine for some objects, but for others, when they're supposed to go back to normal, they go pitch black. More often than not, the ones that are getting messed up have baked textures while the non-baked textures are fine. Are there any image formats that react badly to emissive?
Reply With Quote
  #2  
Old 03-15-2012, 01:07 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
It's possible that the original emissive color of the object is white, so changing it to black is causing the blackout you are seeing.

There is an option in the max exporter to set self-illumination on baked materials. I believe older versions of the exporter would implement this option by setting the emissive color to the same as the diffuse color. So this could be why you see this happening with baked textured objects.

Newer versions of the exporter implement this option by simply disabling lighting on the object. In this case, changing the emissive color will have no effect.

You might need to use a different technique for highlighting objects. Here is one option. You can apply some grayscale texture to the object and use additive blending, so it effectively brightens the entire object. To unhighlight the object, you simply remove the texture. Here is some sample code:
Code:
import viz
import vizact
viz.go()

model = viz.add('plant.osgb',pos=(0,0,5))

highlight = viz.add('highlight.bmp')

def Highlight(mode):
	if mode:
		model.texture(highlight,unit=2)
		tc = viz.TextureCombine()
		tc.combine_rgb = viz.GL_ADD
		model.texCombine(tc,unit=2)
	else:
		model.texture(None,unit=2)

vizact.onkeydown(' ',Highlight,vizact.choice([True,False]))
This technique should work regardless of the lighting mode of the object. Just make sure the texture unit you are using for the highlight texture is not being used by the object.

I've attached a sample highlight image as well.
Attached Images
File Type: bmp highlight.bmp (2.1 KB, 1139 views)
Reply With Quote
  #3  
Old 03-16-2012, 11:17 AM
EnvisMJ EnvisMJ is offline
Member
 
Join Date: May 2009
Location: Purdue University, West Lafayette, Indiana
Posts: 44
Thanks Farshizzo, it's working great :-D
Reply With Quote
Reply

Tags
black, dark, emissive, format, image

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
How to render a texture of the transparent object and then blur it whj Vizard 1 09-25-2012 03:15 PM
how to hide 3D virtual object behind real object? Darkmax Vizard 3 05-29-2012 09:39 AM
Remove link and have object drop/collide? cgibb Vizard 6 03-02-2010 04:18 PM
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
rotate to object jargon Vizard 1 08-08-2005 12:20 PM


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


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