I am right now in a Process of deciding wether to use Unity3d, ThreeJS, BabylonJS or PlayCanvas for a future WebGL Project my Company is working on. PlayCanvas has some really nice Features and is fun to work with. But so far I reached certain Limitations.
I want to achieve the following:
1 Main Texture on an Object that defines the Main Color (this Texture would Use UV-Space 0)
1 Detail Texture on that Object (this would use UV1)
And for each of that textures i want to add a normal Map.
Is it somehow possible to achieve this without spending hours (or even days) in learning how to write an appropriate custom Shader?
PS: It is not possible for me to merge the Detail and Color textures into one Texture, we already tried that and it did not suit our needs in terms of Quality, so the only Option is to use two Textures.
thanks for the fast Reply. Unfortunately this is not possible because the Detail only gets applied to a part of the mesh. Using only one UV-Space would spread the Detail all over the mesh.
edit: To get a better understanding of the Problem. Lets assume I have a Plane. On that Plane i want to have a Cloth-Texture with its Normal Map. And on top of the Cloth material there shall be seams that have their own normal map.
Where N is your geometry normal and TB are defined by UV direction. That’s why using 2 normal maps on 2 different UVs is not efficient, because we need to compute additional vectors and store it on the mesh. PlayCanvas doesn’t support it, but there are also TBN-free ways of doing bump mapping, including the technique used in the example.
thank you for your work. In your Project it looks just like i imagined it But if I try to recreate it I get the following Errors (seems like some Problem with the UV Spaces but my mesh has the correct spaces):
ERROR: 0:93: ‘vUv1’ : undeclared identifier
ERROR: 0:93: ‘perturb_normal’ : no matching overloaded function found
ERROR: 0:93: ‘assign’ : cannot convert from ‘const float’ to 'highp 3-component vector of float’
ERROR: 0:150: ‘vUv1’ : undeclared identifier
ERROR: 0:150: ‘texture2D’ : no matching overloaded function found
ERROR: 0:150: ‘rgb’ : field selection requires structure or vector on left hand side
ERROR: 0:150: ‘=’ : cannot convert from ‘const float’ to 'highp 3-component vector of float’
ERROR: Failed to link shader program. Error: invalid shaders
How exactly do I have to set up the Inspector Variables on the Script (because this is invisible if I look into your project)?
multiply2xMap -> Detail Diffuse Texture? ?
BumpMap -> Detail Height Map
edit: Got it working. Can I somehow modify the tiling of the textures via Script? Because Material-Tiling seems to get overwritten