Code Monkey home page Code Monkey logo

Comments (3)

cochrane avatar cochrane commented on July 21, 2024

Very rough concept for the runtime classes (names TBD):

  • Class ShaderModule: Contains defines, uniforms that are colors, that are floats, and textures, all identified by string ids. Several modules can share their uniforms. E.g. if two modules used at the same time both use baseTexture or shininess, then both get the same value set by the user.
    • Can have children, which are just ShaderModules themselves. Nested arbitrarily deep. Activating a child means necessarily activating the parent.
    • Can have requirements for specific vertex attributes. Such modules will be activated by loading code directly.
    • Can be marked as non-UI; used by the engine depending on scene settings (this might be used for light settings or cube maps or what have you)
  • Class ShaderBase inherits from ShaderModule
    • Adds the actual shader files to use.
  • Class ShaderInstance consists of a ShaderBase and set of ShaderModules (that must all be descendants of that ShaderBase). Calculates effective used set of uniforms, vertex attributes, and preprocessor defines.
  • XNALara Shader specifically for loading XNALara files:
    • Contains a ShaderInstance to use
    • Contains mesh groups to which this ShaderInstance applies
    • Contains mapping from generic_mesh parameter values to shader parameters
    • Used only during loading, ignored by rest of system.

Possible expansion if necessary:

  • ShaderModuleGroup: Can be a child of a ShaderModule. Has a name and a set of ShaderModules. The shader modules are considered mutually exclusive by default.

from gllara.

cochrane avatar cochrane commented on July 21, 2024

Loading from existing scene files:

  • Use the XNALara Shader data to map the existing shader string

Saving scene files:

  • Add array of selected shader modules to GLLItemMesh; use existing shader name as shader base (or new field for this?)

Actually not that difficult.

UI needs to be adapted for this, but having nicer UI is part of the point of all of this.

from gllara.

cochrane avatar cochrane commented on July 21, 2024

Should probably also add a way for models to specify which texture coordinate goes with which texture while we're at it.

from gllara.

Related Issues (20)

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.