| 1 |
{ -*- buffer-read-only: t -*- } |
| 2 |
{ DON'T EDIT -- this file was automatically generated from "source/lighting_model_physical/structures.glsl" } |
| 3 |
'/*' + LineEnding + |
| 4 |
' Copyright 2020-2020 Michalis Kamburelis and glTF-Sample-Viewer authors.' + LineEnding + |
| 5 |
'' + LineEnding + |
| 6 |
' This file is part of "Castle Game Engine".' + LineEnding + |
| 7 |
'' + LineEnding + |
| 8 |
' "Castle Game Engine" is free software; see the file COPYING.txt,' + LineEnding + |
| 9 |
' included in this distribution, for details about the copyright.' + LineEnding + |
| 10 |
'' + LineEnding + |
| 11 |
' "Castle Game Engine" is distributed in the hope that it will be useful,' + LineEnding + |
| 12 |
' but WITHOUT ANY WARRANTY; without even the implied warranty of' + LineEnding + |
| 13 |
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.' + LineEnding + |
| 14 |
'' + LineEnding + |
| 15 |
' ----------------------------------------------------------------------------' + LineEnding + |
| 16 |
'' + LineEnding + |
| 17 |
' Structures for Physical (PBR) lighting model.' + LineEnding + |
| 18 |
' They are included in a special way, to make GLSL code compile both with and without' + LineEnding + |
| 19 |
' "separate compilation units".' + LineEnding + |
| 20 |
'' + LineEnding + |
| 21 |
' Code below is adapted from glTF-Sample-Viewer ( Apache License 2.0 )' + LineEnding + |
| 22 |
' https://github.com/KhronosGroup/glTF-Sample-Viewer/' + LineEnding + |
| 23 |
' In particular src/shaders/metallic-roughness.frag .' + LineEnding + |
| 24 |
'*/' + LineEnding + |
| 25 |
'' + LineEnding + |
| 26 |
'struct AngularInfo' + LineEnding + |
| 27 |
'{' + LineEnding + |
| 28 |
' float NdotL; // cos angle between normal and light direction' + LineEnding + |
| 29 |
' float NdotV; // cos angle between normal and view direction' + LineEnding + |
| 30 |
' float NdotH; // cos angle between normal and half vector' + LineEnding + |
| 31 |
' float LdotH; // cos angle between light direction and half vector' + LineEnding + |
| 32 |
'' + LineEnding + |
| 33 |
' float VdotH; // cos angle between view direction and half vector' + LineEnding + |
| 34 |
'' + LineEnding + |
| 35 |
' vec3 padding;' + LineEnding + |
| 36 |
'};' + LineEnding + |
| 37 |
'' + LineEnding + |
| 38 |
'struct MaterialInfo' + LineEnding + |
| 39 |
'{' + LineEnding + |
| 40 |
' float perceptualRoughness; // roughness value, as authored by the model creator (input to shader)' + LineEnding + |
| 41 |
' vec3 reflectance0; // full reflectance color (normal incidence angle)' + LineEnding + |
| 42 |
'' + LineEnding + |
| 43 |
' float alphaRoughness; // roughness mapped to a more linear change in the roughness (proposed by [2])' + LineEnding + |
| 44 |
' vec3 diffuseColor; // color contribution from diffuse lighting' + LineEnding + |
| 45 |
'' + LineEnding + |
| 46 |
' vec3 reflectance90; // reflectance color at grazing angle' + LineEnding + |
| 47 |
' vec3 specularColor; // color contribution from specular lighting' + LineEnding + |
| 48 |
'};' + LineEnding + |
| 49 |
'' |