zoukankan      html  css  js  c++  java
  • osg osgDB::Options noTexturesInIVEFile ForceReadingImage dds_flip

    osgDB::writeNodeFile(node, path, new osgDB::Options("noTexturesInIVEFile"));

    noTexturesInIVEFile:选项可以在写ive模型文件的时候只写纹理文件对应的路径,而不是默认的将纹理数据写入ive文件

    更多参数,可以查看ReaderWriterIVE.cpp文件中的定义

    osg::Node* osgbNode=osgDB::readNodeFile(osgbModelFile, new osgDB::Options("ForceReadingImage"));

    ForceReadingImage:选项只对osg2,osgb,osgt,osgx起作用,它可以在纹理文件不存在(或者读取失败)时,生成一张空的纹理对象osg::Image,并记录下纹理文件对应的路径

    osg::Node* ddsImageNode=osgDB::readNodeFile(modelFile, new osgDB::Options("dds_flip"));

    在读取模型中含有dds格式纹理的时候,需要用到这个选项。如果在命令行中使用osgviewer aaa.osg -O dds_flip

    OSG自支持格式的升级版是在2010年提出的,它的目的是方便扩展、跨格式可持续更新且支持任何OSG已有的格式。比如它可以代表图片,可以代表heighfield,可以代表模型等等。

    这个升级版的插件代码在此处: src/osgPlugins/osg/ReaderWriterOSG2.cpp and wrappers at src/osgWrappers/serializers.

    它支持两种格式:

    • .osgb二进制格式
    • .osgt Ascii格式

    支持的操作为:

    • WriteImageHint=<hint> (Export option) Hint of writing image to stream.
    • <IncludeData> writes Image::data() directly;
    • <IncludeFile> writes the image file itself to stream;
    • <UseExternal> writes only the filename;
    • <WriteOut> writes Image::data() to disk as external file.
    • # ./osgconv cow.osg cow.osgb -O WriteImageHint=IncludeData
      # ./osgviewer cow.osgb
    • osgDB::writeNodeFile(node, path, new osgDB::Options("WriteImageHint=WriteOut"));
  • 相关阅读:
    提纲挈领webrtc之vad检测
    提纲挈领webrtc音频处理算法之写在前面的话
    搭建git远程服务器三步骤
    详解m4文件
    chrome浏览器被reimage pair 劫持怎么处理
    linux查看系统32位还是64位
    git gc和fsck的用法
    ubuntu 16.04 的64位 安装arm-none-linux-gnueabi-gcc的步骤和问题解决
    利用终端命令实现进入ntfs分区有两种方法。
    ubuntu-14.10下,安装gcc交叉编译器遇到问题及解决方法
  • 原文地址:https://www.cnblogs.com/coolbear/p/4354150.html
Copyright © 2011-2022 走看看