diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2021-01-05 13:01:17 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-05 13:01:17 -0800 |
| commit | 706d4f91e269d473c963d31792fb2c8320933c9b (patch) | |
| tree | 3010f9cc566038c61ab22026df111380db6426a2 /examples/model-viewer | |
| parent | b4f94629f225b837e7102acc337610c5d4d8a7c1 (diff) | |
Add basic GLSL support for SV_Barycentrics (#1648)
* Add basic GLSL support for SV_Barycentrics
This change allows for fragment shader varying inputs marked with the `SV_Barycentrics` semantic to be mapped to GLSL code using the `gl_BaryCoordNV` builtin variable (from he `GL_NV_fragment_shader_barycentric` extension).
This is the simplest possible change to get the functionality up and running, and it leaves out many things that could be desired in a more feature-complete version of the feature later:
* There is no support for alternative extensions that provide similar functionality. Selection of which extension to favor could eventually be based on the "capability" work that has been put in place.
* There is no attempt made to check that the input has the expected type (or to coerce it if it doesn't), so for now this is only going to be guaranteed to work for a `float3` input.
* This change does not expose the `pervertexNV` qualifier added in the `GL_NV_fragment_shader_barycentric` extension, which can be used by a shader to access the uninterpolated vertex inputs.
The last issue is an important one, since the HLSL `GetAttributeAtVertex` function seems to be defiend to work with *any* incoming varying parameter that was marked with `nointerpolation`. When we have a `nointerpolation` input, it would seem that we need to know whether it will be used with `GetAttributeAtVertex` (in which case it should be declared as a `pervertexNV` array input in GLSL) or not (in which case it should be declared as a `nointerpolation` input, without an array).
* fixup: missing file
Diffstat (limited to 'examples/model-viewer')
0 files changed, 0 insertions, 0 deletions
