diff --git a/modules/core/src/index.js b/modules/core/src/index.js index 7cb07ef025..c16c85e2fe 100644 --- a/modules/core/src/index.js +++ b/modules/core/src/index.js @@ -145,6 +145,7 @@ export { dirlight, picking, diffuse, + gouraudlighting, phonglighting, // experimental _transform, diff --git a/modules/shadertools/src/index.js b/modules/shadertools/src/index.js index 9bdbf56a49..1a38a01c27 100644 --- a/modules/shadertools/src/index.js +++ b/modules/shadertools/src/index.js @@ -31,7 +31,7 @@ export {default as lights} from './modules/lights/lights'; export {default as dirlight} from './modules/dirlight/dirlight'; export {default as picking} from './modules/picking/picking'; export {default as diffuse} from './modules/diffuse/diffuse'; -export {default as phonglighting} from './modules/phong-lighting/phong-lighting'; +export {gouraudlighting, phonglighting} from './modules/phong-lighting/phong-lighting'; export {default as pbr} from './modules/pbr/pbr'; // experimental diff --git a/modules/shadertools/src/modules/phong-lighting/phong-lighting.js b/modules/shadertools/src/modules/phong-lighting/phong-lighting.js index fc70799183..2334b5ffa7 100644 --- a/modules/shadertools/src/modules/phong-lighting/phong-lighting.js +++ b/modules/shadertools/src/modules/phong-lighting/phong-lighting.js @@ -1,8 +1,8 @@ import lights from '../lights/lights'; import lightingShader from './phong-lighting.glsl'; -export default { - name: 'phong-lighting', +const gouraudlighting = { + name: 'gouraud-lighting', dependencies: [lights], vs: lightingShader, defines: { @@ -11,6 +11,16 @@ export default { getUniforms }; +const phonglighting = { + name: 'phong-lighting', + dependencies: [lights], + fs: lightingShader, + defines: { + LIGHTING_FRAGMENT: 1 + }, + getUniforms +}; + const INITIAL_MODULE_OPTIONS = {}; function getMaterialUniforms(material) { @@ -35,3 +45,5 @@ function getUniforms(opts = INITIAL_MODULE_OPTIONS) { return Object.assign({}, getMaterialUniforms(material), {lighting_uEnabled: true}); } + +export {gouraudlighting, phonglighting}; diff --git a/package.json b/package.json index 4c240dd9ea..9f041160de 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "eslint-plugin-tree-shaking": "^1.7.3", "gl": "^4.1.1", "mkdirp": "^0.5.1", - "ocular-dev-tools": "0.0.17", + "ocular-dev-tools": "0.0.18", "pre-commit": "^1.2.2", "pre-push": "^0.1.1", "raw-loader": "^0.5.1", diff --git a/yarn.lock b/yarn.lock index ea00f4a0fa..c7ad59fea1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5902,10 +5902,10 @@ obuf@^1.0.0, obuf@^1.1.2: resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== -ocular-dev-tools@0.0.17: - version "0.0.17" - resolved "https://registry.yarnpkg.com/ocular-dev-tools/-/ocular-dev-tools-0.0.17.tgz#fdadd4b8ff0f92610f29cc668e3f7024f94ae62c" - integrity sha512-KHcgHAXxXY+tzacrznkbgjLBcgdR9/26UoNySy5MRXvJLT6s7ilDOQ6kIgZNnwrsLy7miLGraa/NTQ7E2GV3lQ== +ocular-dev-tools@0.0.18: + version "0.0.18" + resolved "https://registry.yarnpkg.com/ocular-dev-tools/-/ocular-dev-tools-0.0.18.tgz#cef24f308076fc765556a9bbdd79fde7a3f46d45" + integrity sha512-3kwimmRPbaacpXrggKPXakFOL0JjbK9py5/nsO87tQAqi0gkHAVgEr1YmYsnnwPLuhFWVKVYrI+YtAMXg4JUMA== dependencies: "@babel/cli" "^7.0.0" "@babel/core" "^7.0.0"