Code Monkey home page Code Monkey logo

Comments (1)

bobcao3 avatar bobcao3 commented on June 9, 2024

可配置化实现的方法:

经过无数次总结--和unity3d的借鉴--

渲染一个物体基本需要两个部分:

  1. 几何数据
  2. 着色器

目前着色器和几何数据都有对应的类,但是实际上几何数据结构被定死了,这就带来一个问题:它渲染的时候有时候有不需要的数据,有时候又多出了数据

所以我建立一个描述结构,用来描述这个几何结构的配置方式,诸如有几个buffer,每个buffer中一个节点由多少byte组成,每个节点有多少个attribute,然后在shader里做好对应的attribute就行

由于OpenGL对attribute数量有限制,实现这个描述结构不会很复杂(一个数组就解决了)

描述结构可以由VMGS来配置,也可以用VM76直接获取结构体内存然后直接写入

那么如此之后,渲染就会有两条指令缓冲,一条是切换着色器,一条是绘图

from vm-76.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.