[Bf-viewport] OpenGL low level shader API proposal

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Dec 6 02:59:55 CET 2015


In this thread we're talking about low level code that will be used
everywhere in Blender, also the game engine. The purpose here is not
to add any new features visible to users or even to boost performance
much, it's only about laying the groundwork.

On Sun, Dec 6, 2015 at 1:38 AM, Jacob Merrill
<blueprintrandom1 at gmail.com> wrote:
> would this new viewport also modify the material system?
>
> PBR an NPR workflow?
>
> and obligatory - Will this render bge usable by the bge? will it boost
> performance their also?
>
>
> On Sat, Dec 5, 2015 at 3:34 PM, Mike Erwin <significant.bit at gmail.com>
> wrote:
>>
>> Yes, thank you! Interesting stuff. Here's my first round of notes:
>>
>> +1 for immutable draw state.
>> +100 for minimizing state changes! Marry desired state to the draw call.
>>
>> Re: Uniform Buffer Objects -- Compatibility with GL 2.1 is a temporary
>> concern, so anything we do there should be minimal and marked for future
>> removal.
>>
>> For passing in the current transformation, I don't think the lowest-level
>> API should treat this or any other inputs special. Do like the convenience
>> of not having to specify CTM every time though... maybe I'm on the fence
>> about this one! Since a lot of this has to do with UI drawing, how about a
>> dedicated 2D transformation system, stack or otherwise? See bottom part of:
>> http://wiki.blender.org/index.php/Dev:2.8/Source/OpenGL/Transformations
>> 3D shaders would automatically get a 3x4 ModelView and 4x4 Projection
>> matrix, maybe a 4x4 MVP for efficiency. 2D shaders would automatically get a
>> 2x3 ModelView matrix and that's it.
>>
>>
>> Some basic assumptions, definitions, questions... please let me know if
>> any of these are way off:
>>
>> GPUShader is a compiled & linked set of Vertex shader, optional Geometry
>> shader, and Fragment shader.
>>
>> Inputs for the GPUShader are the active uniforms (which could be from any
>> of the above shader stages) and vertex attributes from the first stage.
>>
>> Uniform values are set once per draw. Attribute values are typically set
>> per vertex from data in VBOs. Attributes can also be set once per draw using
>> glVertexAttrib, acting more like uniforms from client program's point of
>> view.
>>
>> Uniforms can have default values in GLSL. Is there any way to query the
>> program to see if an input *requires* us to set a value? Beyond parsing the
>> GLSL source text.
>>
>> Anyone interested in parsing GLSL source text?
>>
>>
>> Mike Erwin
>> musician, naturalist, pixel pusher, hacker extraordinaire
>>
>> _______________________________________________
>> Bf-viewport mailing list
>> Bf-viewport at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-viewport
>>
>
>
> _______________________________________________
> Bf-viewport mailing list
> Bf-viewport at blender.org
> http://lists.blender.org/mailman/listinfo/bf-viewport
>


More information about the Bf-viewport mailing list