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"));

osg osgDB::Options noTexturesInIVEFile ForceReadingImage dds_flip的更多相关文章

  1. [osg]osgDB的加载机制,使用3DS插件做参考(转,整理现有osgDB资料)

    参考:http://blog.sina.com.cn/s/blog_7cdaf8b60102uzu3.html http://blog.csdn.net/wang15061955806/article ...

  2. [原][资料整理][osg]osgDB文件读取插件,工作机制,支持格式,自定义插件

    参考: osgPlugins相关 osg读取文件的原理(插件工作机制) 当使用osgDB读取文件时,会自动根据文件的扩展名来到插件目录中寻找相应的插件,来实现. 比如: osgviewer cow.o ...

  3. OSG osgDB FileUtils FileNameUtil操作文件名相关函数

    /** Gets the parent path from full name (Ex: /a/b/c.Ext => /a/b). */extern OSGDB_EXPORT std::stri ...

  4. [转][osg]关于PagedLOD 加载卸载机制

    你的PagedLOD 为什么没有卸载 转自:http://bbs.osgchina.org/forum.php?mod=viewthread&tid=7612&highlight=Pa ...

  5. [osg][osgearth]osg的分页加载,代码和结构图

    DatabasePager加载数据的过程: 多线程 使用DatabasePager加载数据的流程: 左侧的图框表示数据的检索和输入, 中间的白色框表示用于数据存储的内存空间,而右边的图框表示存储数据的 ...

  6. OSG学习笔记0——解决OSG读obj模型问题[转]

    原文:https://blog.csdn.net/u011310341/article/details/51179948 #include "stdafx.h" #include& ...

  7. osg编译日志-release

    1>------ 已启动生成: 项目: ZERO_CHECK, 配置: Release x64 ------1> Checking Build System1> CMake does ...

  8. osg 添加 fbx插件 osg中编译fbx

    使用osg加载fbx模型,需要自己编译fbx插件,编译流程与插件使用案例如下 代码地址:https://github.com/shelltdf/osgFBX CMake Error: The foll ...

  9. OSG开发概览

    1 OSG基础知识 Ø OSG是Open Scene Graphic 的缩写,OSG于1997年诞生于以为滑翔机爱好者之手,Don burns  为了对滑翔机的飞行进行模拟,对openGL的库进行了封 ...

随机推荐

  1. nyoj 4 ASCII码排序 java

    java输入字符:1.String s=sc.next(); 2.char a=s.charAt(0); 注意:package   java 中提交不能带package java代码: import ...

  2. 2013nanjignB

    B - Poor Warehouse Keeper Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & ...

  3. Jquery简单瀑布流代码示例

    最近很多网站都采用瀑布流风格设计,感觉挺有个性的,比较合适做图片类型的网站,没事仿开心网做一个瀑布流示例. 需要用到Jquery,jquery.masonry.min.js <!DOCTYPE ...

  4. PHPCMS系统使用的弹出窗口插件artDialog

    来源: http://aui.github.io/artDialog/doc/index.html  (官方) http://lab.seaning.com/ http://www.mb5u.com/ ...

  5. Longest Common Subsequence

    Given two strings, find the longest common subsequence (LCS). Your code should return the length of  ...

  6. Github如何更新远程代码

    1.git add . 2.git commit -m "Second commit" 3.git push origin master

  7. POJ 3641 快速幂+素数

    http://poj.org/problem?id=3641 练手用,结果念题不清,以为是奇偶数WA了一发 #include<iostream> #include<cstdio> ...

  8. [翻译]opengl扩展教程1

    [翻译]opengl扩展教程1 原文地址https://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/extensions.php [翻译]ope ...

  9. 线段树基础模板&&扫描线

    线段树的单点更新+区间求和 hdu1166敌兵布阵 Input 第一行一个整数T,表示有T组数据. 每组数据第一行一个正整数N(N<=),表示敌人有N个工兵营地 ,接下来有N个正整数,第i个正整 ...

  10. centos python2.6升级到2.7 还有单独的python3.5环境

    查看python版本 #python -V Python 1.下载Python-2.7.3 #wget http://python.org/ftp/python/2.7.3/Python-2.7.3. ...