WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-14-2008, 09:00 AM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Normal Maps

Hi all,

I take it that as i can find no mention of normal maps in the vizard documentation that it is not possible to use them? Is this the unfortunate truth?

Regards

Nigel
Reply With Quote
  #2  
Old 02-14-2008, 02:38 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Vizard has built-in support for vertex/fragment shaders, which means you can implement all sorts of advanced rendering techniques. I've attached a zip file that contains a script that implements normal-bump mapping. You can use the arrow keys to move the light around.
Attached Files
File Type: zip VizardNormalMap.zip (1.08 MB, 564 views)
Reply With Quote
  #3  
Old 02-14-2008, 04:59 PM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Thank you

Thanks for the prompt response farshizzo, again, it's great to know it's possible . While your shader works well with the provided osg, I am having a bit of difficulty using it with my model. Normal maps were created in Max (baked from high poly model) using texture channel 2. Trouble is I get - ## WARNING: Could not generate tangent/binormal data for geometry 'orig_orig_orig_blue', where orig_orig_blue is a material created by max when it baked the normal map. What is the best work flow in your opinion, I notice that only the diffuse map is loaded with the ball.osg, is that how it needs to be done?

Thanks in advance,
Reply With Quote
  #4  
Old 02-15-2008, 11:09 AM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Post Normal Maps

Update on the last message. Got rid of the warning by using a diffuse texture map (rather than the default max shader) and removed the normal map from the model but to no avail, the model is invisible, if i comment out the shader code it's displayed but the diffuse mapping is messed up . I feel I may be missing something really obvious here (too many late nights infront of the computer maybe ).
Has anybody else had experience/success using normal mapping?

Thanks for your patience.
Reply With Quote
  #5  
Old 02-15-2008, 02:48 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Is your model invisible or just black? How large is your model? That sample script assumes the model is very small. If your model is larger then the attenuation on the point light might not reach it.
Reply With Quote
  #6  
Old 02-15-2008, 06:07 PM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Me again!

Hi farshizzo,

Unfortunately the model is invisible, when i comment out the shader code the normal is mapped correctly now tho . I have taken the liberty of attaching the code and osg in the hope that you may be able to throw some light on this problem for me.

Kind regards
Attached Files
File Type: zip NormalTruck.zip (660.5 KB, 507 views)
Reply With Quote
  #7  
Old 02-19-2008, 02:42 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I modified the sample script from my previous post to load your osg file instead, and it worked fine. Did you use the *exact* same script with only the filenames changed?
Reply With Quote
  #8  
Old 02-20-2008, 03:01 AM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Normal Mapping

Hiya Farshizzo,

Yes, all I altered was:
Code:
#ball = viz.add('basketball.osg')
ball = viz.add('Truck01.osg')
#normal_tex = viz.add('bball_normal.jpg')
normal_tex = viz.add('mybodynormalsmap.jpg')
.

Apart from altering the distance on the pivot camera and making the background blue that was all i did, but to no avail.
Is that what you meant?
Thank you for your patience with this matter,

Kindest regards,
Nige
Reply With Quote
  #9  
Old 02-20-2008, 10:04 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I've attached a modified version of the script I posted that replaces the models/textures with yours. I've also made a small tweak to the fragment shader. Try these out, it should work.
Attached Files
File Type: zip BumpShader.zip (1.3 KB, 533 views)
Reply With Quote
  #10  
Old 02-21-2008, 03:55 AM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Thank You!

. Perfect, thank you
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
environment maps, scenes, and you! vadrian Vizard 1 01-12-2005 04:04 PM
generating images for panoramas using cube maps bailenson Vizard 5 09-08-2004 08:32 PM


All times are GMT -7. The time now is 05:52 PM.


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