Dear All,

Current observations:

1) The OSG 2.6 .obj loader loads two textures : a diffuse map, into texture
unit 0, and an "opacity map" into texture unit 1. The OBJ format supports a
variety of other texture maps (e.g "bump", "map_Ks", etc.). This
map-to-texture-unit correspondence is _hardcoded_ in the loader.

2) The 3DS loader has a bunch of potential map loads commented out
(ReaderWriter3DS.cpp, lines 828-842).

General question:

How should OSG cope with map-to-texture unit correspondence? For example, I
can modify the OBJ loader to support map_Ks, bump, etc. but the texture
units will still be hardcoded, and since I don't use an opacity map, the
original author's (Bob Kuehne) map_opacity change will break. A similar
question applied to the 3DS format; I can get it to load up other maps
(specular, opacity, bump etc.) but equally, end up hardcoding against
texture units.

Altenatively, the loader could increment texture units as it finds them in
the input file - this will work for OBJ; I'm not so familiar with 3DS for
this. Then it would be up to the shader to sort things out.

Even more alternatively, one could pass options into the loader that
dictated the correspondence.

Is there a general OSG wide recommended approach for this, or do people just
end up with their own personal customised loaders?

Advice appreciated,

David

(PS : shouldn't "map_opacity" be "map_d" in the obj loader?)
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to