3D model preparation question

98 views
Skip to first unread message

Jeff White

unread,
Mar 25, 2021, 2:46:39 PM3/25/21
to OpenSceneGraph Users
A few of my 3D model files (which are in .obj format) look different when loaded into Blender compared to viewing them in osgviewer.  I can see all the colors clearly in Blender but in osgviewer the model appears dark.  I have attached a few pictures here.  I commonly see this with older model files that have materials specified but no associated textures.

I am a developer and not a 3D modeler so I don't have enough Blender experience to know why it looks different in that software.  Is there something else I need to do to prepare these models for use in OSG?  I know that Blender places a light in the scene but I thought that osgviewer had a small light pointing out of the camera as well.

Any help would be appreciated.  Thanks,

Jeff
model_example.PNG
osgviewer_example.PNG

Trajce Nikolov NICK

unread,
Mar 26, 2021, 11:58:51 AM3/26/21
to osg-...@googlegroups.com
Hi Jeff,

I know this problem as well. Obviously each .obj file has .mtl file with it. It is a text file where materials and textures are defined. You can edit with values you find appropriate . As well check the texture paths

--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/96f91a17-9cdd-4f03-9d98-7e2defcbcf55n%40googlegroups.com.


--
trajce nikolov nick

Jeff White

unread,
Mar 26, 2021, 5:41:02 PM3/26/21
to OpenSceneGraph Users
Thanks for the info. I had already checked the .mtl file and there are no textures referenced in this model.  It does everything with materials.  All material names in the .obj match what is in the .mtl file as well so I'm not sure what the problem is.  The paths all reference the current directory so those should be fine.

If anyone knows of a Blender export plugin for .ive or .osgb that might be helpful.  I haven't found one yet so I am assuming I will probably have to write one myself.

Trajce Nikolov NICK

unread,
Mar 27, 2021, 6:31:30 AM3/27/21
to osg-...@googlegroups.com
there is a short procedure to export the model with textures - there are youtube videos online for this. I think you have to check the selected - see the image

image.png



--
trajce nikolov nick

Wojciech Lewandowski

unread,
Mar 27, 2021, 8:04:18 AM3/27/21
to osg-...@googlegroups.com
Jeff,

This is most probably caused by lighting in osg viewer not set in the same way as in blender. I bet ambient component is too low but I won't give a penny for it.
Could be also related to materials not applied correctly although I doubt it.

Check usual suspects:
GL_LIGHTING to on
add your own GL_LIGHT
If neccessary increase ambient lighting component

check GL_COLOR_MATERIAL settings  
set GL_NORMALIZE_NORMALs to true

You can use osgconv to convert to osgt (most human friendly osg text format) and examine the outputs in text editor (specifically materials and lighting settings). Compare them or alter them with materials/lighting from dumptruck model in osg data.
If your model is not proprietary attach it and we may check it ourselves.

Cheers,
Wojtek




Reply all
Reply to author
Forward
0 new messages