email comments from Andew Sampson,
"I've contacted Terrex, and obtained the 2.2 version
of their trpage library. The library included a
fork of OSG 0.9.8's txp plugin, modified to load 2.1+
txp DBs.
I've done the work of incorporating the changes made
to OSG's txp plugin since 0.9.8 into Terrex's fork.
The forked version is now up-to-date with the changes
made to OSG 0.9.9 and 1.0.
Terrex made a lot of changes (especially differences
in whitespace), so the diff between the forked version
and OSG 1.0's txp plugin is yucky. I did my best, but
keep in mind that this is the result of a 4-way merge
(kinda... terrex-0.9.8, stock-0.9.8, stock-0.9.9,
stock-1.0).
I really want to see this forked version merged back
into the main OSG branch. The new features offered by
this version of the plugin (2.1+ support, variable
LOD support, bug fixes) are worth the trouble."
--
Don Tidrow then took this code and added his work.
--
Robert Osfield then fixed all the warnings that abound in the trpage code base.
There are some group codes (i.e. "62") which are interpreted as
dxfDataType::SHORT. That's right because the dxf-specification defines
"16 bit integer" as the type for the corresponding value.
But readerBase::readGroup() calls readValue(std::ifstream&, unsigned
short). I changed readValue(std::ifstream&, unsigned short) to
readValue(std::ifstream&, short). I found no group code at the dxf-specs
which needs a "16 bit unsigned integer" value. So the
readValue(std::ifstream&, unsigned short) function is obsolete - right?
changes to this plugin that aren't in current CVS yet -- this change is
based on current CVS, not our changed files.)
This changes how shader palette records are parsed to support GLSL per the
OpenFlight 16.1 spec. Existing functionality for 16.0 files is preserved.
The change to Document.h simply adds an enum for VERSION_16_1."
"- Replaced some member attributes with local variables in Face record.
- Multitexture support in Vertex class.
- Renamed VertexList to VertexListRecord (VertexList is now a Vertex array)
- new Mesh (with reserved field at offset 12, thanks to Paul Martz)
- new LocalVertexPool
- new MeshPrimitive
- Use ProxyNode for externals.
- Local cache for externals"
that removeChild(Node*), removeChild(uint) and equivilant Geode methods are
now inline methods, not designed to be overriden, and seperated out the
multiple remove method to be called removeChildren(uint, uint) which is
now the only virtual method. There removeChildren is now the method to
override in subclasses.
This reorganisation requires some call code to be rename removeChild usage
to removeChildren.
2. Fixed a problem with the caching of textures when CACHE_IMAGES was enabled. This caused a conflict is the names used to cache the image and texture objects.
3. Fixed a problem where AC3D generates surfaces with duplicate vertex indices.
4. Removed what I believe are redundant calls to the tesselator.
5. Added a couple of asserts which should fire in debug mode if my assumptions about 4. are incorrect.
6. Removed obviously unused code. (Stuff that was commented or ifdeffed out.)"
Note, from Robert Osfield, changed the asserts to if () report error using notify so we can catch errors in both optimized and debug builds, but without crashing.
supports compressing the image data. The option to compress the data
is "compressImageData". Currently it uses the jpeg plugin to write the
image. Maybe we could add an option that allows the user to specify
which image format to use. The jpeg writer supports specifying the
quality of the jpeg, so you could use the following command line to
convert the skydome.osg model to IVE using 50% jpeg quality:
osgconv -O "compressImageData JPEG_QUALITY 50" skydome.osg skydome.ive"
of saving image files inside the IVE file. Currently, only the raw
image data is saved into the file. If your model uses jpg images as
textures then this will cause your file size to increase.
I've added an option that will embed the original image file into the
IVE file. The IVE file will then attempt to read the image from
memory. Since most image loaders support reading from memory, this
shouldn't be a problem. To use this new feature the user must specify
the option "includeImageFileInIVEFile" when converting to IVE.
I tested this out on the "skydome.osg" model that comes with OSG.
Using the old method, the IVE file size would be 785 KB, with the new
method it is only 42 KB.
Also, I've added the support for TextureRectangle's to the IVE reader/writer."
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>
confirmed then close and reopen as an ascii as required. This is done to get
round problems under Windows.
Also made the running of the SmoothingVisitor optional, now use -O smooth to
make the loader run the osgUtil::SmoothingVisitor over the model.
Normally the automatic setup is useful, but in the case of the .osg support this automatic
update was forcing premature loading of imagery that wasn't necessarily, and can lead to
reports of looking for files that arn't present.
light points. This was due to the mismatch is size and fiels in the LightPointRecord
before 15.6 and after it, the OSG's flt plugin was assuming just 15.6 record
structure. As a temporary solution I have disabled the processing of light point
records on .flt file version before 15.6, this allows these files to be loaded
safely, but without light points.
readFontStream() to load fonts from a std::istream, rather than from the
local filesystem by name. Such a call may be used, for example, if the
user has a font fetched over a network, or a font available in memory
without a correspondng filename.
The changes implement the new function by following the corresponding code
for readFontFile(). readFontStream() reads a stream into memory, and
holds that memory for FreeType.
As a basic test, I mangled the osgtext example to use
readFontStream(std::ifstream("font")) in lieu of a readFontFile call, and
the modified example ran completely."
discovered that TXPNodes were being culled out prematurely because the
loaded sub-tiles resulted in a computed bounds that was smaller than the
extents indicated in the archive. I think this fix should be fine. I can't
think of any reason why we would want to use anything other than the archive
extents."
"This is a small fix for flt2osg.[cpp|h] that handles
old style road segments ( from Multigen II w/road
tools on IRIX ) in the same way as the newer road
constructions. ie create a group and do a nested
traversal.
This makes roads appear in older format files where
there was previously a gap. This actually works
properly with the paths which are marked as hidden in
the openflight database."
get positioned correctly when the TXP database was built using the
'tile-offset' mode. I've included a tarball with what I believe are the
needed changes - they work for the sample databases I have available,
but not all conditions have been tested. I've set things up such that
these changes shouldn't affect 'normal' txp databases."
"
This fixes some crashing issues I was having with certain FLT files that only had partial colour palettes
Which are typically found in older 14.x files and file converted through Polytrans or Deep exploration etc.
The code that grabs the color entries in ConvertFromFLT::visitColorPalette was assuming that there were full
palettes always coming in and stepping was out of bounds in certain cases (not all) and thus crashing with
access violations etc,
Although the normal from Creator is to have 1024 or 512 entries , this is not a really requirement of the format, just the way Creator creates its default palettes etc.
Code changed to look at the number of entries and use just those and fills in any missing entries with a default white colour"
"I add a new option in the HDR Reader.
The RAW option store the RGBE values into a Image, to use
this option you need to decode the RGBE value in the frag-
ment shader. Follow the cube map glsl decoder:
vec4 textureCubeRGBE( uniform samplerCube sampler, vec3 coords )
{
ivec4 rgbe = textureCube( sampler, coords ) * 255. + 0.5;
float e = rgbe.a - ( 128 + 8 );
return vec4( rgbe.rgb * exp2( e ), 1.0 );
}
This option is usefull for who have a outdate hardware like
FX cards and want to do cool things.
Finally this patch is need by a new HDR Rendering example
that I will put on the Wiki."
to be correctly importated from HDR files.
From Robert Osfield, tweaked the above to allow the original casting to RGB8 as an
options switched on by a osgDB::ReaderWriter::Options string with a value of "RGB8".
"On fixing the pointer access I discovered that reading osga archives
containing ive files went into a cpu loop. This turned out to be a
problem with proxy_streambuf on Solaris. Public methods in the Solaris
streambuf standard library implementation rely on the gptr() being set,
which proxy_streambuf was not doing. So I have modified
proxy_streambuf to set the input sequence pointers, and have also
aligned it more with the standard library streambuf implementation
where all input is through underflow(), not uflow() which merely calls
underflow() and advances the pointer."
From Robert Osfield, change from using pointer cast and assignment to using
a templated _write and _read method to avoid pointer aliasing to 2/4/8
byte boundaries that some computer system may produce. These changes
where inspried by Colin McDonalds change to using memcpy, these
changes weren't merged as memcpy is not as clear in naming as _read,
_write and memcpy will incurr a function call just for copy a
uint.
"I took a closer look at the conditional code in
SeamFinder::seamReplacement().
Because _info.minRange is a double and lod->getMinRange(0) is a float,
the difference will be calculated with double precision. If
_info.minRange is cast as a float it is exactly the same value as
lod->getMinRange(0) and the difference is exactly zero.
So if you change
if((fabs(_info.minRange-lod->getMinRange(0))<0.001)&&(fabs(_info.lod0Range-lod->getMaxRange(0))<0.001))
to
if((fabs((float)_info.minRange-lod->getMinRange(0))<0.001)&&(fabs((float)_info.lod0Range-lod->getMaxRange(0))<0.001))
it works a lot better."
"DOFAnimation's default state could now be controlled by the RW option.
The option string is "dofAnimation"
If the option string is omitted the default animation state is off."
"ConvertFromFLT::addMultiTexture makes ENDIAN conversion for SMultiTexture
struct attributes.
When an flt object is multi-instantiated y should be done just first time,
because SMultiTexture struct is always the same, currently is being done for
each instance.
Attached file fix the problem but perhaps a more clean fix would be making
ENDIAN conversion at writing attributes time instead of at reading time. "
ac3d loader - better sharing of states between objects and Roger James' bug fix for missing normals.
Tesselator.cpp - faster processing of polygon tesselation for single triangles (which dont need to be tesselated)
osgtesselate.cpp - added wrap for texture so that appearance is as originally. Default texture behaviour has changed to clamp."
if ( in->getVersion() >= VERSION_0006 ) {
setDatabasePath(in->readString());
}
instead of
if ( in->getVersion() > VERSION_0006 ) {
setDatabasePath(in->readString());
}
Seems DatabasePath _is_ present in ive files of version 6.
versions prior to 15.8, and...
" Here's another fix for OpenFlight. The symptom was that ATTR files were
not being read correctly, and the TexEnv on a texture that should have
been set to DECAL was instead defaulting to MODULATE. The cause is that
the ATTR reader cannot tell by itself what version it's reading (the
version information isn't present in the ATTR files), and instead relies
on the ReaderWriter::Options passed in to get the OpenFlight version.
My change clones the current ReaderWriter::Options and prepends the
appropriate FLT_VER option before the ReaderWriterATTR object is
called. I also made the parsing of the FLT_VER string and value more
robust in the ReaderWriterATTR itself. I think I commented things OK,
but let me know if you need me to explain anything."
"Attached is the new source for the Quicktime-Plugin which adds the
ability to write pictures in various formats (tested: jpg, png, tif,
psd) (24bit + 32bit only, 8bit not tested)
There are changes in the attached osgDB::Registry, which allows osg to
find resources/plugins in the right folders under OS X"
Note, from Robert Osfield, changed the FilePathList* filepath + delete to a
FilePathList filepath to avoid possible memory leaks when expections are thrown/
make it more maintainable. Also didn't merge the automatic playing of movies.
"Here there are fixes for several flt loader problems.
First one was an small bug when root database was an empty string we got a database path "/" instead of "./".
Second one is more complex. Flt loader works in two passes, first one reads flt database and second one builds osg scenegraph. Special care must be taken for properly tracking database path as nested files are entered. Because textures are loaded in second pass, mentioned care should be taken once again. I wrote time ago a piece of code and I placed it in both files fltFile.cpp and flt2osg.cpp. After a long period offline I have seen the portion of code at flt2osg was missing, I just made some tests and I could see it is still required.
Finally, I have seen that pool.cpp always try to make IMAGE cache instead of reading what Options says.
Aditonally, I recently wrote an osg change, now it has external references "a la flt" what is called osg::ProxyNode. As part of the change now flt loader builds external references as ProxyNodes. I made the same mistake like pool.cpp and always made ARCHIVE cache instead of see what Options says, it has also been fixed."
for each Lighwave surface, in order to keep surface names (geometries can't
have names). The attached fix adds a plugin option named "COMBINE_GEODES"
that allows to place all geometries under a single Geode whenever possible,
thus offering better chances of further optimization through
osgUtil::Optimizer. The downside is that surface names are no longer stored
in the scene graph when using this option."