From Marco Jez:
here is a patch that enables a new option named "BIND_TEXTURE_MAP" in the LWO plugin. Its purpose is to allow explicit binding between texture UV maps defined in the LWO file and OpenGL texture units, overriding the default mechanism that allocates texture units automatically. This is useful when you have an UV map built in Lightwave (for example an atlas map) but no textures actually using it, so you can keep the UV map (that would be discarded otherwise) and add a texture later int your program. Syntax is: BIND_TEXTURE_MAP <map_name> <texunit>
This commit is contained in:
@@ -98,6 +98,15 @@ lwosg::Converter::Options ReaderWriterLWO::parse_options(const Options *options)
|
||||
if (opt == "FORCE_ARB_COMPRESSION") conv_options.force_arb_compression = true;
|
||||
if (opt == "USE_OSGFX") conv_options.use_osgfx = true;
|
||||
if (opt == "NO_LIGHTMODEL_ATTRIBUTE") conv_options.apply_light_model = false;
|
||||
if (opt == "BIND_TEXTURE_MAP")
|
||||
{
|
||||
std::string mapname;
|
||||
int unit;
|
||||
if (iss >> mapname >> unit)
|
||||
{
|
||||
conv_options.texturemap_bindings.insert(std::make_pair(mapname, unit));
|
||||
}
|
||||
}
|
||||
if (opt == "MAX_TEXTURE_UNITS") {
|
||||
int n;
|
||||
if (iss >> n) {
|
||||
|
||||
Reference in New Issue
Block a user