build can be splitted correctly, gl_Position shouldnât been wrong. Maybe BBL draws color and depth at different time. When BBL draws depth, it didnât bind custom uniforms for submesh.
In your case I would recommend going the NME road instead as we can not guarantee back compat of our shaders internally and those are the kind of things which will be impossible to foresee.
i use the different depth parameter that not use LOG
** notice that mathematical function not always make same result in the different GPU specially when you talk about sensitive data
so i prefer use âgl_FragCoord.zâ
by this calculate ((2.0 * near * far) / (far + near - (gl_FragCoord.z*2.-1.) * (far - near)))/far
I find that nodeMaterial can be created by uniqueURL or file, could it created by a string field? My project will work at local area network , and automatic build program do not support to move each xxxxx.xxx.fx/.json file into public folder, it is very cumbersome to push NME file into built package by hand. These are why I donât willing to use NME ,maybe I just need static way to create nodeMaterial, once built , never change
Thank you for your help!!! Maybe my explanation is not clear enough (my English is very bad), I will try my best to eaplan it clearly
My main problem is that when I change vertexShader of PBRCustomMaterial (like I move a mesh upward with an uniform upwardValue in vertexShader ----- positionUpdated.y += upwardValue;) In Color Space the mesh has been moved up 100 unit, but in Depth Space, the mesh is stand still. When light scaning, it looks like a ghost shadow in original location. It seems that uniforms wasnât setted into submesh when scene rendered this mesh into depth.
yes, I read the pbr.vertex.fx, customPBRMaterial use gl_Position.w to calculate depth, gl_Position is calculated by worldPos, worldPos is calculated by positionUpdated. I add code in Vertex_Before_PositionUpdated where positionUpdated is defined but worldPos isnât defined.
In this order, I change positionUpdated, gl_Position is changed correctly, but depth not change.
This picture is draw with a screen space postprocess Effect, It samplers depth map, calculate world position for each fragment, then output worldposition mod 100.(I think it is best way to show depthMap than linear gray 0-1)