WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Normal Maps (https://forum.worldviz.com/showthread.php?t=1348)

nige777 02-14-2008 09:00 AM

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

farshizzo 02-14-2008 02:38 PM

1 Attachment(s)
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.

nige777 02-14-2008 04:59 PM

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',:confused: 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,

nige777 02-15-2008 11:09 AM

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 :o).
Has anybody else had experience/success using normal mapping?

Thanks for your patience.

farshizzo 02-15-2008 02:48 PM

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.

nige777 02-15-2008 06:07 PM

Me again!
 
1 Attachment(s)
Hi farshizzo,

Unfortunately the model is invisible, when i comment out the shader code the normal is mapped correctly now tho :rolleyes:. 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

farshizzo 02-19-2008 02:42 PM

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?

nige777 02-20-2008 03:01 AM

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

farshizzo 02-20-2008 10:04 AM

1 Attachment(s)
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.

nige777 02-21-2008 03:55 AM

Thank You!
 
:cool:. Perfect, thank you


All times are GMT -7. The time now is 12:34 AM.

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