# Error on new SSRRenderingPipeline()

**URL:** <https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812>\
**Category:** Questions\
**Created:** [June 21, 2023, 3:11pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812 "2023-06-21T15:11:01Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![DWork](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@DWork](https://forum.babylonjs.com/u/DWork)\
**Post date:** [June 21, 2023, 3:11pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/1 "2023-06-21T15:11:01Z")

</div>

When i added SSR to my project, browser always console multi error.I had tried to find out the problem, but still wihout any success. Although it does not affect functionality, i still hope to resolve this problem.  
Sorry, but i cannot pot the code on PG, the project is huge.  
Here are the error msg as below:

> BJS - [22:49:33]: Unable to compile effect:

> BJS - [22:49:33]: Uniforms: world, mBones, viewProjection, diffuseMatrix, view, previousWorld, previousViewProjection, mPreviousBones, bumpMatrix, reflectivityMatrix, albedoMatrix, reflectivityColor, albedoColor, metallic, glossiness, vTangentSpaceParams, vBumpInfos, morphTargetInfluences, morphTargetTextureInfo, morphTargetTextureIndices, vClipPlane, vClipPlane2, vClipPlane3, vClipPlane4, vClipPlane5, vClipPlane6, diffuseSampler, bumpSampler, reflectivitySampler, albedoSampler, morphTargets

> BJS - [22:49:33]: Attributes: position, normal

> BJS - [22:49:33]: Defines:  
> #define REFLECTIVITYCOLOR  
> #define GLOSSINESSS  
> #define REFLECTIVITY  
> #define REFLECTIVITY\_INDEX 2  
> #define NUM\_BONE\_INFLUENCERS 0  
> #define RENDER\_TARGET\_COUNT 4

> BJS - [22:49:33]: Vertex code:

> BJS - [22:49:33]: #version 300 es  
> #define WEBGL2  
> #define REFLECTIVITYCOLOR  
> #define GLOSSINESSS  
> #define REFLECTIVITY  
> #define REFLECTIVITY\_INDEX 2  
> #define NUM\_BONE\_INFLUENCERS 0  
> #define RENDER\_TARGET\_COUNT 4  
> #define SHADER\_NAME vertex:geometry  
> precision highp float;  
> uniform mat4 world;  
> layout(std140,column\_major) uniform;  
> uniform Scene {  
> mat4 viewProjection;  
> mat4 view;  
> mat4 projection;  
> vec4 vEyePosition;  
> };  
> in vec3 position;  
> in vec3 normal;  
> out vec3 vNormalV;  
> out vec4 vViewPos;  
> #define CUSTOM\_VERTEX\_DEFINITIONS  
> void main(void)  
> {  
> vec3 positionUpdated=position;  
> vec3 normalUpdated=normal;  
> mat4 finalWorld=world;  
> vec4 worldPos=vec4(finalWorld_vec4(positionUpdated,1.0));  
> vNormalV=normalize(vec3((view_finalWorld)_vec4(normalUpdated,0.0)));  
> vViewPos=view_worldPos;  
> gl\_Position=viewProjection_finalWorld_vec4(positionUpdated,1.0);  
> }

> BJS - [22:49:33]: Fragment code:

> BJS - [22:49:33]: #version 300 es  
> #define WEBGL2  
> #define REFLECTIVITYCOLOR  
> #define GLOSSINESSS  
> #define REFLECTIVITY  
> #define REFLECTIVITY\_INDEX 2  
> #define NUM\_BONE\_INFLUENCERS 0  
> #define RENDER\_TARGET\_COUNT 4  
> #define SHADER\_NAME fragment:geometry  
> precision highp float;  
> in vec3 vNormalV;  
> in vec4 vViewPos;  
> uniform vec3 reflectivityColor;  
> layout(location=0) out vec4 glFragData[RENDER\_TARGET\_COUNT];  
> const float PI=3.1415926535897932384626433832795;  
> const float HALF\_MIN=5.96046448e-08;  
> const float LinearEncodePowerApprox=2.2;  
> const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;  
> const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);  
> const float Epsilon=0.0000001;  
> #define saturate(x) clamp(x,0.0,1.0)  
> #define absEps(x) abs(x)+Epsilon  
> #define maxEps(x) max(x,Epsilon)  
> #define saturateEps(x) clamp(x,Epsilon,1.0)  
> mat3 transposeMat3(mat3 inMatrix) {  
> vec3 i0=inMatrix[0];  
> vec3 i1=inMatrix[1];  
> vec3 i2=inMatrix[2];  
> mat3 outMatrix=mat3(  
> vec3(i0.x,i1.x,i2.x),  
> vec3(i0.y,i1.y,i2.y),  
> vec3(i0.z,i1.z,i2.z)  
> );  
> return outMatrix;  
> }  
> mat3 inverseMat3(mat3 inMatrix) {  
> float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];  
> float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];  
> float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];  
> float b01=a22_a11-a12_a21;  
> float b11=-a22_a10+a12_a20;  
> float b21=a21_a10-a11_a20;  
> float det=a00_b01+a01_b11+a02_b21;  
> return mat3(b01,(-a22_a01+a02_a21),(a12_a01-a02_a11),  
> b11,(a22_a00-a02_a20),(-a12_a00+a02_a10),  
> b21,(-a21_a00+a01_a20),(a11_a00-a01_a10))/det;  
> }  
> float toLinearSpace(float color)  
> {  
> return pow(color,LinearEncodePowerApprox);  
> }  
> vec3 toLinearSpace(vec3 color)  
> {  
> return pow(color,vec3(LinearEncodePowerApprox));  
> }  
> vec4 toLinearSpace(vec4 color)  
> {  
> return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);  
> }  
> float toGammaSpace(float color)  
> {  
> return pow(color,GammaEncodePowerApprox);  
> }  
> vec3 toGammaSpace(vec3 color)  
> {  
> return pow(color,vec3(GammaEncodePowerApprox));  
> }  
> vec4 toGammaSpace(vec4 color)  
> {  
> return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);  
> }  
> float square(float value)  
> {  
> return value_value;  
> }  
> vec3 square(vec3 value)  
> {  
> return value_value;  
> }  
> float pow5(float value) {  
> float sq=value_value;  
> return sq_sq_value;  
> }  
> float getLuminance(vec3 color)  
> {  
> return clamp(dot(color,LuminanceEncodeApprox),0.,1.);  
> }  
> float getRand(vec2 seed) {  
> return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))_43758.5453);  
> }  
> float dither(vec2 seed,float varianceAmount) {  
> float rand=getRand(seed);  
> float normVariance=varianceAmount/255.0;  
> float dither=mix(-normVariance,normVariance,rand);  
> return dither;  
> }  
> const float rgbdMaxRange=255.0;  
> vec4 toRGBD(vec3 color) {  
> float maxRGB=maxEps(max(color.r,max(color.g,color.b)));  
> float D =max(rgbdMaxRange/maxRGB,1.);  
> D =clamp(floor(D)/255.0,0.,1.);  
> vec3 rgb=color.rgb_D;  
> rgb=toGammaSpace(rgb);  
> return vec4(clamp(rgb,0.,1.),D);  
> }  
> vec3 fromRGBD(vec4 rgbd) {  
> rgbd.rgb=toLinearSpace(rgbd.rgb);  
> return rgbd.rgbbd.a;  
> }  
> vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {  
> vec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;  
> vec3 halfSize=cubeSize\*0.5;  
> vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)_invOrigVec;  
> vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)invOrigVec;  
> vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);  
> float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);  
> vec3 intersectPositionWS=vertexPos+origVecdistance;  
> return intersectPositionWS-cubePos;  
> }  
> void main() {  
> vec3 normalOutput;  
> normalOutput=normalize(vNormalV);  
> glFragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);  
> glFragData[1]=vec4(normalOutput,1.0);  
> vec4 reflectivity=vec4(0.0,0.0,0.0,1.0);  
> reflectivity.rgb=toLinearSpace(reflectivityColor.xyz);  
> reflectivity.a=1.0;  
> reflectivity.a_=glossiness;  
> glFragData[REFLECTIVITY\_INDEX]=reflectivity;  
> }

> BJS - [22:49:33]: Offending line [130] in fragment code: reflectivity.a\*=glossiness;

> BJS - [22:49:33]: Error: FRAGMENT SHADER ERROR: 0:130: ‘glossiness’ : undeclared identifier

---

<div class="post-metadata">

**Author:** ![Michael\_Prosser](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/michael_prosser/32/6062_2.png) [@Michael\_Prosser](https://forum.babylonjs.com/u/Michael_Prosser)\
**Post date:** [June 21, 2023, 3:13pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/2 "2023-06-21T15:13:48Z")

</div>

I think the error messages got cut off. Can you repost?

---

<div class="post-metadata">

**Author:** ![DWork](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@DWork](https://forum.babylonjs.com/u/DWork)\
**Post date:** [June 21, 2023, 3:15pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/3 "2023-06-21T15:15:17Z")

</div>

updated

---

<div class="post-metadata">

**Author:** ![Michael\_Prosser](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/michael_prosser/32/6062_2.png) [@Michael\_Prosser](https://forum.babylonjs.com/u/Michael_Prosser)\
**Post date:** [June 21, 2023, 3:24pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/4 "2023-06-21T15:24:39Z")

</div>

What version of BABYLONJS are you using?

Do you have all the prerequisites in place?

> **[Screen Space Reflections (SSR) Rendering Pipeline | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/SSRRenderingPipeline#prerequisites)**
>
> Learn about the screen space reflection rendering pipeline in Babylon.js.

---

<div class="post-metadata">

**Author:** ![DWork](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@DWork](https://forum.babylonjs.com/u/DWork)\
**Post date:** [June 21, 2023, 3:44pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/5 "2023-06-21T15:44:39Z")

</div>

I had test from v6.0 to last version, the same problem. The initializtion setup follow document

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [June 21, 2023, 3:51pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/6 "2023-06-21T15:51:43Z")

</div>

It seems it’s a problem with the geometry buffer renderer: can you test with the prepass renderer?

You need to set the 4rd parameter of the `SSRRenderingPipeline` constructor to `false` to use the prepass renderer.

---

<div class="post-metadata">

**Author:** ![DWork](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@DWork](https://forum.babylonjs.com/u/DWork)\
**Post date:** [June 21, 2023, 3:59pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/7 "2023-06-21T15:59:28Z")

</div>

It’s right, but some problom with MSAA on prepass renderer, how to solve aniti-aliasing on prepass renderer mode?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [June 21, 2023, 4:03pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/8 "2023-06-21T16:03:44Z")

</div>

As per the doc, the best way is to use FXAA instead of MSAA.

But it’s a bug for sure, so we need to fix it, it should work with the geometry buffer renderer. Just to be sure, you are only using standard / PBR materials in your scene?

---

<div class="post-metadata">

**Author:** ![DWork](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@DWork](https://forum.babylonjs.com/u/DWork)\
**Post date:** [June 21, 2023, 4:05pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/9 "2023-06-21T16:05:01Z")

</div>

yes, my project 3D models all for GLTF only

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [June 21, 2023, 4:12pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/10 "2023-06-21T16:12:16Z")

</div>

Assigned @Evgeni\_Popov on June 21, 2023, 4:12pm UTC



---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [June 21, 2023, 4:16pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/11 "2023-06-21T16:16:49Z")

</div>

Unassigned @Evgeni\_Popov on June 21, 2023, 4:16pm UTC



---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [June 21, 2023, 4:16pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/12 "2023-06-21T16:16:58Z")

</div>

This PR will fix the problem:

> <https://github.com/BabylonJS/Babylon.js/pull/13992>
>
> See https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812

---

<div class="post-metadata">

**Author:** ![DWork](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@DWork](https://forum.babylonjs.com/u/DWork)\
**Post date:** [June 21, 2023, 4:29pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/13 "2023-06-21T16:29:10Z")

</div>

This issue only occurs during initialization, and there are no apparent problems afterwards. However, the error message displayed, the users could worry about it, and impact their experience. SSR is a great feature, 3D project places a strong emphasis on visual effects, the geometry buffer being the best option. I hope bbl team can fix this issue.  
Sorry to distrub BBL team, I have been using babylonjs for fews years. I hope it can be a more prowerful WebGL Engine.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [June 25, 2023, 2:45pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/14 "2023-06-25T14:45:41Z")

</div>

Is the fix ok for you?

---

<div class="post-metadata">

**Author:** ![DWork](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@DWork](https://forum.babylonjs.com/u/DWork)\
**Post date:** [June 25, 2023, 3:04pm UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/15 "2023-06-25T15:04:52Z")

</div>

It’s perfect now, after update v6.9.0

---

<div class="post-metadata">

**Author:** ![wayne2000](https://avatars.discourse-cdn.com/v4/letter/w/ea5d25/32.png) [@wayne2000](https://forum.babylonjs.com/u/wayne2000)\
**Post date:** [November 27, 2023, 1:52am UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/16 "2023-11-27T01:52:48Z")

</div>

[https://playground.babylonjs.com/#PIZ1GK#1551](https://playground.babylonjs.com/#PIZ1GK#1551)

Please help to take a look at this scene, when you put const forceGeometryBuffer = true; When set to true, the Chrome browser on mobile devices will report an error and lose the reflection effect. It should be related to the character’s GLB file, which was downloaded from [https://www.mixamo.com](https://www.mixamo.com) website.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/4/64259c848fb0fc3fa2dfe9a1a752d222a7000494.jpeg)

And the characters in this scene don’t have this error: [https://playground.babylonjs.com/#PIZ1GK#1552](https://playground.babylonjs.com/#PIZ1GK#1552)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 27, 2023, 11:12am UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/17 "2023-11-27T11:12:54Z")

</div>

The problem is that the model has too many bones (170) and because the geometry buffer renderer is passing bone matrices through uniforms to the shader.

This PR will fix the problem:

> <https://github.com/BabylonJS/Babylon.js/pull/14548>
>
> See https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/16
> 
> …We used uniforms even when bone texture was supported because of the velocity target (which only supports passing previous bone data through uniforms). The PR let use bone texture for the model while still using uniforms for previous bone data.

---

<div class="post-metadata">

**Author:** ![wayne2000](https://avatars.discourse-cdn.com/v4/letter/w/ea5d25/32.png) [@wayne2000](https://forum.babylonjs.com/u/wayne2000)\
**Post date:** [November 28, 2023, 2:02am UTC](https://forum.babylonjs.com/t/error-on-new-ssrrenderingpipeline/41812/18 "2023-11-28T02:02:16Z")

</div>

Thank you so much
