WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-08-2013, 07:03 AM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Question Level of Detail and Shaders

Dear Vizard Support,

I had a question regarding LOD support and Vizard.

I know I can manually setup LOD within 3Ds Max with various ranges.

However, my issue is a bit simpler than needing geometry of various poly-counts. I have a shader which really throttles our hardware ( normal mapping, ambient occlusion, multiple light source, etc...). A very small percentage of the objects in the scene ( this is an open environment, seen from above) will actually be close enough at any one time to need the shader. Objects further away could easily use the standard fixed-functionality pipeline.

Is there any way to access, use, pull out and of the OSG LOD object ranges or support while Vizard is executing? The idea being that I'd rewrite the shader to use a simpler method when objects are farther away than close.

Sort of a 'turn-on / off' switch? Or even a value I can get returned to me so I know when I hit an LOD range? Or even a value I could send to the shader so it knows to use a different function when calculating lighting?
Reply With Quote
  #2  
Old 08-13-2013, 08:27 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I don't see the need to detect the LOD range from within the shader. Just apply the more detailed shader to the closer range node and the simpler shader to the far range node. Whichever node is active will now render using its associated shader.
Reply With Quote
  #3  
Old 08-14-2013, 11:36 AM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
I guess what I am trying to get at is that I didn't want to create an LOD object in max that references the same model twice when all I want to do is swap the shader applied to the model.

If I understand correctly, the fix you are recommending requires the LOD object in Max be created and exported. I'd need a naming convention saying the object is an LOD object, and upon loading I'd then need to get the node names and identify the LOD order ( by some naming convention again ) and apply my shader to the lowest LOD object, leave all subsequent objects to default to the regular vertex shading.
Reply With Quote
  #4  
Old 08-15-2013, 09:23 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Ok, I see two ways to go about this:

1) Use a LOD node with with a different group node for each range, but the same base model is added to each group node. So you still retain only one instance of the model. Then you can apply the different shaders to each group node.

2) Compute the distance of the viewpoint to the object within the vertex shader and use that as a way to dynamically switch between simpler and complex computations.

I would consider method 1 more ideal, but it might be more difficult to setup. Also, if you have different shaders applied to various sub-parts of the model, then method 1 won't work.
Reply With Quote
Reply

Tags
lod, shader

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


All times are GMT -7. The time now is 04:20 PM.


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