|
@@ -3,6 +3,8 @@ import {
|
|
|
Vector3
|
|
Vector3
|
|
|
} from 'three';
|
|
} from 'three';
|
|
|
|
|
|
|
|
|
|
+/** @module GodRaysShader */
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* God-rays (crepuscular rays)
|
|
* God-rays (crepuscular rays)
|
|
|
*
|
|
*
|
|
@@ -17,10 +19,11 @@ import {
|
|
|
* 6*6*6 = 216 samples.
|
|
* 6*6*6 = 216 samples.
|
|
|
*
|
|
*
|
|
|
* References:
|
|
* References:
|
|
|
|
|
+ * - [Sousa2008, Crysis Next Gen Effects, GDC2008]{@link http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt}.
|
|
|
*
|
|
*
|
|
|
- * Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt
|
|
|
|
|
|
|
+ * @constant
|
|
|
|
|
+ * @type {Object}
|
|
|
*/
|
|
*/
|
|
|
-
|
|
|
|
|
const GodRaysDepthMaskShader = {
|
|
const GodRaysDepthMaskShader = {
|
|
|
|
|
|
|
|
name: 'GodRaysDepthMaskShader',
|
|
name: 'GodRaysDepthMaskShader',
|
|
@@ -72,8 +75,10 @@ const GodRaysDepthMaskShader = {
|
|
|
*
|
|
*
|
|
|
* The results of the previous pass are re-blurred, each time with a
|
|
* The results of the previous pass are re-blurred, each time with a
|
|
|
* decreased distance between samples.
|
|
* decreased distance between samples.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @constant
|
|
|
|
|
+ * @type {Object}
|
|
|
*/
|
|
*/
|
|
|
-
|
|
|
|
|
const GodRaysGenerateShader = {
|
|
const GodRaysGenerateShader = {
|
|
|
|
|
|
|
|
name: 'GodRaysGenerateShader',
|
|
name: 'GodRaysGenerateShader',
|
|
@@ -194,8 +199,10 @@ const GodRaysGenerateShader = {
|
|
|
/**
|
|
/**
|
|
|
* Additively applies god rays from texture tGodRays to a background (tColors).
|
|
* Additively applies god rays from texture tGodRays to a background (tColors).
|
|
|
* fGodRayIntensity attenuates the god rays.
|
|
* fGodRayIntensity attenuates the god rays.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @constant
|
|
|
|
|
+ * @type {Object}
|
|
|
*/
|
|
*/
|
|
|
-
|
|
|
|
|
const GodRaysCombineShader = {
|
|
const GodRaysCombineShader = {
|
|
|
|
|
|
|
|
name: 'GodRaysCombineShader',
|
|
name: 'GodRaysCombineShader',
|
|
@@ -253,8 +260,10 @@ const GodRaysCombineShader = {
|
|
|
/**
|
|
/**
|
|
|
* A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be
|
|
* A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be
|
|
|
* cheaper/faster/simpler to implement this as a simple sun sprite.
|
|
* cheaper/faster/simpler to implement this as a simple sun sprite.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @constant
|
|
|
|
|
+ * @type {Object}
|
|
|
*/
|
|
*/
|
|
|
-
|
|
|
|
|
const GodRaysFakeSunShader = {
|
|
const GodRaysFakeSunShader = {
|
|
|
|
|
|
|
|
name: 'GodRaysFakeSunShader',
|
|
name: 'GodRaysFakeSunShader',
|