mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
update shaders
This commit is contained in:
parent
c05cbf065b
commit
4fc6466250
24 changed files with 185 additions and 662 deletions
|
|
@ -159,6 +159,34 @@ void LightingModel::setWireframe(bool enable) {
|
|||
bool LightingModel::isWireframeEnabled() const {
|
||||
return (bool)_parametersBuffer.get<Parameters>().enableWireframe;
|
||||
}
|
||||
|
||||
void LightingModel::setBloom(bool enable) {
|
||||
if (enable != isBloomEnabled()) {
|
||||
_parametersBuffer.edit<Parameters>().enableBloom = (float)enable;
|
||||
}
|
||||
}
|
||||
bool LightingModel::isBloomEnabled() const {
|
||||
return (bool)_parametersBuffer.get<Parameters>().enableBloom;
|
||||
}
|
||||
|
||||
void LightingModel::setSkinning(bool enable) {
|
||||
if (enable != isSkinningEnabled()) {
|
||||
_parametersBuffer.edit<Parameters>().enableSkinning = (float)enable;
|
||||
}
|
||||
}
|
||||
bool LightingModel::isSkinningEnabled() const {
|
||||
return (bool)_parametersBuffer.get<Parameters>().enableSkinning;
|
||||
}
|
||||
|
||||
void LightingModel::setBlendshape(bool enable) {
|
||||
if (enable != isBlendshapeEnabled()) {
|
||||
_parametersBuffer.edit<Parameters>().enableBlendshape = (float)enable;
|
||||
}
|
||||
}
|
||||
bool LightingModel::isBlendshapeEnabled() const {
|
||||
return (bool)_parametersBuffer.get<Parameters>().enableBlendshape;
|
||||
}
|
||||
|
||||
MakeLightingModel::MakeLightingModel() {
|
||||
_lightingModel = std::make_shared<LightingModel>();
|
||||
}
|
||||
|
|
@ -169,6 +197,7 @@ void MakeLightingModel::configure(const Config& config) {
|
|||
_lightingModel->setLightmap(config.enableLightmap);
|
||||
_lightingModel->setBackground(config.enableBackground);
|
||||
_lightingModel->setHaze(config.enableHaze);
|
||||
_lightingModel->setBloom(config.enableBloom);
|
||||
|
||||
_lightingModel->setObscurance(config.enableObscurance);
|
||||
|
||||
|
|
@ -186,6 +215,9 @@ void MakeLightingModel::configure(const Config& config) {
|
|||
|
||||
_lightingModel->setShowLightContour(config.showLightContour);
|
||||
_lightingModel->setWireframe(config.enableWireframe);
|
||||
|
||||
_lightingModel->setSkinning(config.enableSkinning);
|
||||
_lightingModel->setBlendshape(config.enableBlendshape);
|
||||
}
|
||||
|
||||
void MakeLightingModel::run(const render::RenderContextPointer& renderContext, LightingModelPointer& lightingModel) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ public:
|
|||
|
||||
void setHaze(bool enable);
|
||||
bool isHazeEnabled() const;
|
||||
void setBloom(bool enable);
|
||||
bool isBloomEnabled() const;
|
||||
|
||||
void setObscurance(bool enable);
|
||||
bool isObscuranceEnabled() const;
|
||||
|
|
@ -69,6 +71,10 @@ public:
|
|||
|
||||
void setWireframe(bool enable);
|
||||
bool isWireframeEnabled() const;
|
||||
void setSkinning(bool enable);
|
||||
bool isSkinningEnabled() const;
|
||||
void setBlendshape(bool enable);
|
||||
bool isBlendshapeEnabled() const;
|
||||
|
||||
UniformBufferView getParametersBuffer() const { return _parametersBuffer; }
|
||||
|
||||
|
|
@ -102,9 +108,9 @@ protected:
|
|||
float enableWireframe { 0.0f }; // false by default
|
||||
|
||||
float enableHaze{ 1.0f };
|
||||
float spare1; // Needed for having the LightingModel class aligned on a 4 scalar boundary for gpu
|
||||
float spare2;
|
||||
float spare3;
|
||||
float enableBloom{ 1.0f };
|
||||
float enableSkinning{ 1.0f };
|
||||
float enableBlendshape{ 1.0f };
|
||||
|
||||
Parameters() {}
|
||||
};
|
||||
|
|
@ -142,6 +148,11 @@ class MakeLightingModelConfig : public render::Job::Config {
|
|||
Q_PROPERTY(bool enableWireframe MEMBER enableWireframe NOTIFY dirty)
|
||||
Q_PROPERTY(bool showLightContour MEMBER showLightContour NOTIFY dirty)
|
||||
|
||||
Q_PROPERTY(bool enableBloom MEMBER enableBloom NOTIFY dirty)
|
||||
Q_PROPERTY(bool enableSkinning MEMBER enableSkinning NOTIFY dirty)
|
||||
Q_PROPERTY(bool enableBlendshape MEMBER enableBlendshape NOTIFY dirty)
|
||||
|
||||
|
||||
public:
|
||||
MakeLightingModelConfig() : render::Job::Config() {} // Make Lighting Model is always on
|
||||
|
||||
|
|
@ -168,6 +179,10 @@ public:
|
|||
bool enableWireframe { false }; // false by default
|
||||
bool enableHaze{ true };
|
||||
|
||||
bool enableBloom{ true };
|
||||
bool enableSkinning{ true };
|
||||
bool enableBlendshape{ true };
|
||||
|
||||
signals:
|
||||
void dirty();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ struct LightingModel {
|
|||
vec4 _ScatteringDiffuseSpecularAlbedo;
|
||||
vec4 _AmbientDirectionalPointSpot;
|
||||
vec4 _ShowContourObscuranceWireframe;
|
||||
vec4 _Haze_spareyzw;
|
||||
vec4 _HazeBloomSkinningBlendshape;
|
||||
};
|
||||
|
||||
// See DeferredShader_BufferSlot in DeferredLightingEffect.cpp
|
||||
|
|
@ -78,7 +78,16 @@ float isWireframeEnabled() {
|
|||
}
|
||||
|
||||
float isHazeEnabled() {
|
||||
return lightingModel._Haze_spareyzw.x;
|
||||
return lightingModel._HazeBloomSkinningBlendshape.x;
|
||||
}
|
||||
float isBloomEnabled() {
|
||||
return lightingModel._HazeBloomSkinningBlendshape.y;
|
||||
}
|
||||
float isSkinningEnabled() {
|
||||
return lightingModel._HazeBloomSkinningBlendshape.z;
|
||||
}
|
||||
float isBlendshapeEnabled() {
|
||||
return lightingModel._HazeBloomSkinningBlendshape.w;
|
||||
}
|
||||
|
||||
<@endfunc@>
|
||||
|
|
|
|||
|
|
@ -1641,7 +1641,7 @@ void Model::createRenderItemSet() {
|
|||
shapeID++;
|
||||
}
|
||||
}
|
||||
_blendedVertexBuffersInitialized = true;
|
||||
_blendshapeBuffersInitialized = true;
|
||||
}
|
||||
|
||||
bool Model::isRenderable() const {
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// <$_SCRIBE_FILENAME$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// Created by Olivier Prat on 04/24/17.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
_color.a = inColor.w;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// <$_SCRIBE_FILENAME$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// Created by Sam Gateau on 11/21/14.
|
||||
// Copyright 2013 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
// pass along the color in linear space
|
||||
_color.rgb = color_sRGBToLinear(inColor.xyz);
|
||||
|
||||
// and the texture coordinates
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap_fade.vert
|
||||
// vertex shader
|
||||
//
|
||||
// Created by Olivier Prat on 06/05/17.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
|
||||
void main(void) {
|
||||
// pass along the color in linear space
|
||||
_color.rgb = color_sRGBToLinear(inColor.xyz);
|
||||
_color.a = 1.0;
|
||||
|
||||
// and the texture coordinates
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||
}
|
||||
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap_normal_map.vert
|
||||
// vertex shader
|
||||
//
|
||||
// Created by Sam Gateau on 11/21/14.
|
||||
// Copyright 2013 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
// pass along the color in linear space
|
||||
_color.rgb = color_sRGBToLinear(inColor.xyz);
|
||||
_color.a = 1.0;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangentWS)$>
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap_normal_map_fade.vert
|
||||
// vertex shader
|
||||
//
|
||||
// Created by Olivier Prat on 06/05/17.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
<$declareStandardTransform()$>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
|
||||
void main(void) {
|
||||
// pass along the color in linear space
|
||||
_color.rgb = color_sRGBToLinear(inColor.xyz);
|
||||
_color.a = 1.0;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangentWS)$>
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// <$_SCRIBE_FILENAME$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// Created by Olivier Prat on 04/24/17.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
<$declareStandardTransform()$>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
_color.a = inColor.a;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangentWS)$>
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
// model_translucent.vert
|
||||
// vertex shader
|
||||
//
|
||||
// Created by Olivier Prat on 15/01/18.
|
||||
// Copyright 2018 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
_color.a = inColor.a;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
// model_translucent_normal_map.vert
|
||||
// vertex shader
|
||||
//
|
||||
// Created by Olivier Prat on 23/01/18.
|
||||
// Copyright 2018 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
_color.a = inColor.a;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangentWS)$>
|
||||
}
|
||||
|
|
@ -15,24 +15,31 @@
|
|||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning()$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning()$>
|
||||
|
||||
<@include Blendshape.slh@>
|
||||
<$declareApplyBlendshapeOffsets(1)$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 interpolatedNormal = vec3(0.0, 0.0, 0.0);
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 deformedNormal = vec3(0.0, 0.0, 0.0);
|
||||
applyBlendshapeOffset(gl_VertexID, inPosition, deformedPosition, inNormal.xyz, deformedNormal);
|
||||
|
||||
skinPositionNormal(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, position, interpolatedNormal);
|
||||
vec4 skinnedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 skinnedNormal = vec3(0.0, 0.0, 0.0);
|
||||
skinPositionNormal(inSkinClusterIndex, inSkinClusterWeight, deformedPosition, deformedNormal, skinnedPosition, skinnedNormal);
|
||||
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
|
|
@ -45,6 +52,6 @@ void main(void) {
|
|||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normalWS.xyz)$>
|
||||
<$transformModelToWorldAndEyeAndClipPos(cam, obj, skinnedPosition, _positionWS, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, skinnedNormal, _normalWS.xyz)$>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,24 +15,31 @@
|
|||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning(1)$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning(1)$>
|
||||
|
||||
<@include Blendshape.slh@>
|
||||
<$declareApplyBlendshapeOffsets(1)$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 interpolatedNormal = vec3(0.0, 0.0, 0.0);
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 deformedNormal = vec3(0.0, 0.0, 0.0);
|
||||
applyBlendshapeOffset(gl_VertexID, inPosition, deformedPosition, inNormal.xyz, deformedNormal);
|
||||
|
||||
skinPositionNormal(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, position, interpolatedNormal);
|
||||
vec4 skinnedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 skinnedNormal = vec3(0.0, 0.0, 0.0);
|
||||
skinPositionNormal(inSkinClusterIndex, inSkinClusterWeight, deformedPosition, deformedNormal, skinnedPosition, skinnedNormal);
|
||||
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
|
|
@ -45,6 +52,6 @@ void main(void) {
|
|||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normalWS.xyz)$>
|
||||
<$transformModelToWorldAndEyeAndClipPos(cam, obj, skinnedPosition, _positionWS, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, skinnedNormal, _normalWS.xyz)$>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// <$_SCRIBE_FILENAME$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// Created by Olivier Prat on 06/045/17.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning()$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 interpolatedNormal = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
skinPositionNormal(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, position, interpolatedNormal);
|
||||
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
_color.a = inColor.a;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, position, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normalWS.xyz)$>
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// <$_SCRIBE_FILENAME$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// Created by Olivier Prat on 06/045/17.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning(1)$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 interpolatedNormal = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
skinPositionNormal(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, position, interpolatedNormal);
|
||||
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
_color.a = inColor.a;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, position, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normalWS.xyz)$>
|
||||
}
|
||||
|
|
@ -15,14 +15,18 @@
|
|||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning()$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning()$>
|
||||
|
||||
<@include Blendshape.slh@>
|
||||
<$declareApplyBlendshapeOffsets(1, 1)$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
|
|
@ -30,11 +34,18 @@ layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
|||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 interpolatedNormal = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 interpolatedTangent = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 deformedNormal = vec3(0.0, 0.0, 0.0);
|
||||
vec3 deformedTangent = vec3(0.0, 0.0, 0.0);
|
||||
applyBlendshapeOffset(gl_VertexID, inPosition, deformedPosition, inNormal.xyz, deformedNormal, inTangent.xyz, deformedTangent);
|
||||
|
||||
skinPositionNormalTangent(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, inTangent.xyz, position, interpolatedNormal.xyz, interpolatedTangent.xyz);
|
||||
vec4 skinnedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 skinnedNormal = vec3(0.0, 0.0, 0.0);
|
||||
vec3 skinnedTangent = vec3(0.0, 0.0, 0.0);
|
||||
skinPositionNormalTangent(inSkinClusterIndex, inSkinClusterWeight, deformedPosition, deformedNormal, deformedTangent, skinnedPosition, skinnedNormal, skinnedTangent);
|
||||
|
||||
// skinnedNormal = normalize(skinnedNormal);
|
||||
// skinnedTangent = normalize(skinnedTangent);
|
||||
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
|
|
@ -42,18 +53,12 @@ void main(void) {
|
|||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord01.zw)$>
|
||||
|
||||
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
|
||||
interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0);
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, interpolatedNormal.xyz)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedTangent.xyz, interpolatedTangent.xyz)$>
|
||||
|
||||
_normalWS = interpolatedNormal.xyz;
|
||||
_tangentWS = interpolatedTangent.xyz;
|
||||
<$transformModelToWorldAndEyeAndClipPos(cam, obj, skinnedPosition, _positionWS, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, skinnedNormal, _normalWS.xyz)$>
|
||||
<$transformModelToWorldDir(cam, obj, skinnedTangent, _tangentWS.xyz)$>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,12 +16,18 @@
|
|||
<@include render-utils/ShaderConstants.h@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning(1)$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning(1)$>
|
||||
|
||||
<@include Blendshape.slh@>
|
||||
<$declareApplyBlendshapeOffsets(1, 1)$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
|
|
@ -29,11 +35,18 @@ layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
|||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 interpolatedNormal = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 interpolatedTangent = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 deformedNormal = vec3(0.0, 0.0, 0.0);
|
||||
vec3 deformedTangent = vec3(0.0, 0.0, 0.0);
|
||||
applyBlendshapeOffset(gl_VertexID, inPosition, deformedPosition, inNormal.xyz, deformedNormal, inTangent.xyz, deformedTangent);
|
||||
|
||||
skinPositionNormalTangent(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, inTangent.xyz, position, interpolatedNormal.xyz, interpolatedTangent.xyz);
|
||||
vec4 skinnedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 skinnedNormal = vec3(0.0, 0.0, 0.0);
|
||||
vec3 skinnedTangent = vec3(0.0, 0.0, 0.0);
|
||||
skinPositionNormalTangent(inSkinClusterIndex, inSkinClusterWeight, deformedPosition, deformedNormal, deformedTangent, skinnedPosition, skinnedNormal, skinnedTangent);
|
||||
|
||||
skinnedNormal = normalize(skinnedNormal);
|
||||
skinnedTangent = normalize(skinnedTangent);
|
||||
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
|
|
@ -41,18 +54,12 @@ void main(void) {
|
|||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord01.zw)$>
|
||||
|
||||
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
|
||||
interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0);
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord01.zw)$>
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, interpolatedNormal.xyz)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedTangent.xyz, interpolatedTangent.xyz)$>
|
||||
|
||||
_normalWS = interpolatedNormal.xyz;
|
||||
_tangentWS = interpolatedTangent.xyz;
|
||||
<$transformModelToWorldAndEyeAndClipPos(cam, obj, skinnedPosition, _positionWS, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldDir(cam, obj, skinnedNormal, _normalWS.xyz)$>
|
||||
<$transformModelToWorldDir(cam, obj, skinnedTangent, _tangentWS.xyz)$>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// <$_SCRIBE_FILENAME$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// Created by Hifi Engine Team.
|
||||
// Created by Olivier Prat on 06/045/17.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning()$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 interpolatedNormal = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 interpolatedTangent = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
skinPositionNormalTangent(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, inTangent.xyz, position, interpolatedNormal.xyz, interpolatedTangent.xyz);
|
||||
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
_color.a = inColor.a;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord01.zw)$>
|
||||
|
||||
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
|
||||
interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0);
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, position, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, interpolatedNormal.xyz)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedTangent.xyz, interpolatedTangent.xyz)$>
|
||||
|
||||
_normalWS = interpolatedNormal.xyz;
|
||||
_tangentWS = interpolatedTangent.xyz;
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// <$_SCRIBE_FILENAME$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// Created by Hifi Engine Team.
|
||||
// Copyright 2013 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning(1)$>
|
||||
|
||||
<@include graphics/MaterialTextures.slh@>
|
||||
<$declareMaterialTexMapArrayBuffer()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
||||
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
||||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 interpolatedNormal = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 interpolatedTangent = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
skinPositionNormalTangent(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, inTangent.xyz, position, interpolatedNormal.xyz, interpolatedTangent.xyz);
|
||||
|
||||
// pass along the color
|
||||
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
||||
_color.a = inColor.a;
|
||||
|
||||
TexMapArray texMapArray = getTexMapArray();
|
||||
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
||||
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord01.zw)$>
|
||||
|
||||
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
|
||||
interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0);
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, position, _positionWS)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, interpolatedNormal.xyz)$>
|
||||
<$transformModelToWorldDir(cam, obj, interpolatedTangent.xyz, interpolatedTangent.xyz)$>
|
||||
|
||||
_normalWS = interpolatedNormal.xyz;
|
||||
_tangentWS = interpolatedTangent.xyz;
|
||||
}
|
||||
|
|
@ -17,12 +17,20 @@
|
|||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning()$>
|
||||
|
||||
<@include Blendshape.slh@>
|
||||
<$declareApplyBlendshapeOffsets()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
skinPosition(inSkinClusterIndex, inSkinClusterWeight, inPosition, position);
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
applyBlendshapeOffset(gl_VertexID, inPosition, deformedPosition);
|
||||
|
||||
vec4 skinnedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
skinPosition(inSkinClusterIndex, inSkinClusterWeight, deformedPosition, skinnedPosition);
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
|
||||
<$transformModelToClipPos(cam, obj, skinnedPosition, gl_Position)$>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,20 @@
|
|||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning(1)$>
|
||||
|
||||
<@include Blendshape.slh@>
|
||||
<$declareApplyBlendshapeOffsets()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
skinPosition(inSkinClusterIndex, inSkinClusterWeight, inPosition, position);
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
applyBlendshapeOffset(gl_VertexID, inPosition, deformedPosition);
|
||||
|
||||
vec4 skinnedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
skinPosition(inSkinClusterIndex, inSkinClusterWeight, deformedPosition, skinnedPosition);
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
|
||||
<$transformModelToClipPos(cam, obj, skinnedPosition, gl_Position)$>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,15 +20,23 @@
|
|||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning()$>
|
||||
|
||||
<@include Blendshape.slh@>
|
||||
<$declareApplyBlendshapeOffsets()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
skinPosition(inSkinClusterIndex, inSkinClusterWeight, inPosition, position);
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
applyBlendshapeOffset(gl_VertexID, inPosition, deformedPosition);
|
||||
|
||||
vec4 skinnedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
skinPosition(inSkinClusterIndex, inSkinClusterWeight, deformedPosition, skinnedPosition);
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, position, _positionWS)$>
|
||||
<$transformModelToClipPos(cam, obj, skinnedPosition, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, skinnedPosition, _positionWS)$>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,21 +14,29 @@
|
|||
<@include gpu/Inputs.slh@>
|
||||
<@include gpu/Transform.slh@>
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
<@include Skinning.slh@>
|
||||
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
<@include Skinning.slh@>
|
||||
<$declareUseDualQuaternionSkinning(1)$>
|
||||
|
||||
<@include Blendshape.slh@>
|
||||
<$declareApplyBlendshapeOffsets()$>
|
||||
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
||||
|
||||
void main(void) {
|
||||
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
skinPosition(inSkinClusterIndex, inSkinClusterWeight, inPosition, position);
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
applyBlendshapeOffset(gl_VertexID, inPosition, deformedPosition);
|
||||
|
||||
vec4 skinnedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
skinPosition(inSkinClusterIndex, inSkinClusterWeight, deformedPosition, skinnedPosition);
|
||||
|
||||
// standard transform
|
||||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, position, _positionWS)$>
|
||||
<$transformModelToClipPos(cam, obj, skinnedPosition, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, skinnedPosition, _positionWS)$>
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue