|
@@ -23,6 +23,7 @@ precision highp int;
|
|
|
|
|
|
#ifdef USE_SOURCE_PANORAMA
|
|
#ifdef USE_SOURCE_PANORAMA
|
|
uniform sampler2D source_panorama; //texunit:0
|
|
uniform sampler2D source_panorama; //texunit:0
|
|
|
|
+uniform float source_resolution;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
|
|
#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
|
|
@@ -44,7 +45,6 @@ uniform samplerCube source_cube; //texunit:0
|
|
|
|
|
|
uniform int face_id;
|
|
uniform int face_id;
|
|
uniform float roughness;
|
|
uniform float roughness;
|
|
-uniform float source_resolution;
|
|
|
|
|
|
|
|
in highp vec2 uv_interp;
|
|
in highp vec2 uv_interp;
|
|
|
|
|
|
@@ -332,6 +332,7 @@ void main() {
|
|
|
|
|
|
if (ndotl > 0.0) {
|
|
if (ndotl > 0.0) {
|
|
|
|
|
|
|
|
+#ifdef USE_SOURCE_PANORAMA
|
|
float D = DistributionGGX(N, H, roughness);
|
|
float D = DistributionGGX(N, H, roughness);
|
|
float ndoth = max(dot(N, H), 0.0);
|
|
float ndoth = max(dot(N, H), 0.0);
|
|
float hdotv = max(dot(H, V), 0.0);
|
|
float hdotv = max(dot(H, V), 0.0);
|
|
@@ -342,17 +343,14 @@ void main() {
|
|
|
|
|
|
float mipLevel = roughness == 0.0 ? 0.0 : 0.5 * log2(saSample / saTexel);
|
|
float mipLevel = roughness == 0.0 ? 0.0 : 0.5 * log2(saSample / saTexel);
|
|
|
|
|
|
-#ifdef USE_SOURCE_PANORAMA
|
|
|
|
sum.rgb += texturePanorama(L, source_panorama, mipLevel).rgb * ndotl;
|
|
sum.rgb += texturePanorama(L, source_panorama, mipLevel).rgb * ndotl;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
|
|
#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
|
|
-
|
|
|
|
sum.rgb += textureDualParaboloidArray(L).rgb * ndotl;
|
|
sum.rgb += textureDualParaboloidArray(L).rgb * ndotl;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef USE_SOURCE_DUAL_PARABOLOID
|
|
#ifdef USE_SOURCE_DUAL_PARABOLOID
|
|
-
|
|
|
|
sum.rgb += textureDualParaboloid(L).rgb * ndotl;
|
|
sum.rgb += textureDualParaboloid(L).rgb * ndotl;
|
|
#endif
|
|
#endif
|
|
|
|
|