sort of vague auto-ish shader idea

About Monkey 2 Forums Monkey 2 Development sort of vague auto-ish shader idea

This topic contains 2 replies, has 3 voices, and was last updated by  DruggedBunny 2 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6857

    codifies
    Participant

    I’ve had these sort of half formed ideas for a while now, basically both a fragment and vert shader source should be very easy to parse out the attribute and uniform names. ( to basically produce a map of names to ID’s)

    keeping to a set list of “basic” uniforms and attributes *all* shaders must have (the stuff all shaders have in common like vertex coordinates and UV and so forth) should allow any shaders written for this system to be thrown at the factory method for a Shader class and should just drop in place (you could try multiple different shaders with minimal changes – especially if they only used the “basic” uniforms and attributes)

    The “common” variables would probably be used to set specific fields in the Shader for the sake of speed.

    Additionally it should be very easy to “port” any old shaders that comes from webgl source code or wherever, just by renaming some of the variables…

    I’m just throwing this out here in the hope someone has some thoughts on this, that might lead somewhere…

    #6966

    cocon
    Participant

    So this basically tells that if you write a special parser that understands specific source patterns, or comment tags, you would generate custom vertex attributes dynamically.

    #7070

    DruggedBunny
    Participant

    I’ve always thought it would be great to have a ‘ShaderFunction’ (or PixelShader/VertexShader/etc function types) that can be defined within the game’s Blitz/Monkey source, allowing only a very limited subset of the language that’s then translated to GLSL/whatever.

    Crude example…

    … and of course mx2 would spit out the relevant .glsl and deal with all the setup as part of the build process.

    I think making shaders much more accessible like this would get many more of us into shader programming!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.