当前位置: 首页 > news >正文

OgreNext高级材质中增加线宽,点大小,虚线模式绘制支持

 修改Ogre高级材质系统,增加线宽,点大小,虚线模式,虚线参数的支持,效果如下:

需要修改的代码文件如下:

修改如下

代码文本: 

         //范围[0.2 - 51]  0.2 * [0,255];Ogre::uint8 mLineWidth;//范围[0.5 - 127.5]  0.5 * [0, 255];Ogre::uint8 mPointSize;//虚线标记Ogre::uint16 mLineStrip; //虚线重复因子Ogre::uint8 mLineRepatFactor;  //glLineStipple(repatFactor, lineStrip)  glLineStipple(1, 0x0F0F)//是否虚线模式bool mEnableLineStipple;  // Ogre::uint8  // glEnalbe( GL_LINE_STIPPLE )  
                  mPolygonMode != _r.mPolygonMode || mLineWidth != _r.mLineWidth ||mPointSize != _r.mPointSize ||mLineStrip !=  _r.mLineStrip ||mLineRepatFactor != _r.mLineRepatFactor ||mEnableLineStipple != _r.mEnableLineStipple;

修改文件:

代码文本: 

mPolygonMode( PM_SOLID ),mLineWidth(5),mPointSize(2),mLineStrip(0xFFFF),mLineRepatFactor(1),mEnableLineStipple(false)

修改文件:

代码文本: 

        PFNGLLINESTRIPPLEPROC                                   LineStripple;#define glLineStipple									 gl3wProcs.gl.LineStripple

修改文件:

代码文本: 

// add ext func
typedef void( APIENTRYP PFNGLLINESTRIPPLEPROC )( GLint factor, GLushort pattern );

修改文件:

对结构体修改的重命名不需要,测试影响范围才改的。

代码文本如下:

        float     lineWidth;float     pointSize;bool      enableLineStipple;//GLshort   lineStrip;//GLshort   lineRepeatFactor;//bool      enablePointSmooth;

修改文件:

代码文本如下:

        pso->lineWidth = newBlock->macroblock->mLineWidth * 0.2f;pso->pointSize = newBlock->macroblock->mPointSize * 0.5f;pso->enableLineStipple = newBlock->macroblock->mEnableLineStipple;// GLshort   lineStrip;// GLshort   lineRepeatFactor;// bool      enablePointSmooth;switch( macroblock->mPolygonMode )
{case PM_POINTS:OCGE( glPointSize( pso->pointSize));break;case PM_WIREFRAME:glLineWidth( pso->lineWidth );#define GL_LINE_STIPPLE 0x0B24 //这个不属于coreif( macroblock->mEnableLineStipple ){    OCGE( glEnable( GL_LINE_STIPPLE ) );if( glLineStipple )OCGE( glLineStipple( macroblock->mLineRepatFactor, macroblock->mLineStrip ) );}else{OCGE( glDisable( GL_LINE_STIPPLE ) );}break;// case PM_SOLID:default:  break;
}

修改文件:

代码文本如下:

"glLineStipple",

支持解析材质json:

http://www.lryc.cn/news/458467.html

相关文章:

  • STM32中的DMA数据转运——下篇
  • 51单片机的智能小区安防系统【proteus仿真+程序+报告+原理图+演示视频】
  • 数仓建模流程
  • Neo4j CQL语句 使用教程
  • STM32-HAL库 驱动DS18B20温度传感器 -- 2024.10.8
  • HTML 符号
  • 编译后的MySQL安装
  • Ubuntu安装Apache教程
  • Nginx跳转模块之location与rewrite
  • oracle col命令
  • ESP32接入扣子(Coze) API使用自定义智能体
  • 【JVM】如何判断对象是否可以被回收
  • CloseableHttpResponse 类(代表一个可关闭的 HTTP 响应)
  • C语言编程规范及命名规则
  • Pika 1.5 - Pika Labs最新推出的AI视频生成工具
  • Elon Musk 正式揭晓了特斯拉的Robotaxi和Robovan,这两款自动驾驶新车型成为发布会上的焦点
  • 博客摘录「 springboot+netty+mqtt服务端实现」2024年10月11日
  • Docker小白入门笔记
  • Unity 如何在 iOS 新增键盘 KeyCode 响应事件
  • pytorh学习笔记——波士顿房价预测
  • 让AI像人一样思考和使用工具,reAct机制详解
  • Linux系列-常见的指令(二)
  • Leecode刷题之路第17天之电话号码的字母组合
  • 2023牛客暑期多校训练营3(题解)
  • Magnum IO
  • Flink job的提交流程
  • git操作pull的时候出现冲突怎么解决
  • Sentinel 1.80(CVE-2021-44139)
  • 黑马程序员C++提高编程学习笔记
  • 力扣第1题:两数之和(图解版)