
These include texture size limits, transparencies, and refection/refraction materials. There are some limitations though that you must consider.
TEXTUREPACKER SCALE MODE SERIES
The system assumes textures are 1:1 ratio (square).Ĭreate a TexturePacker series by calling: let pack = new BABYLON.TexturePacker(name, targetMeshes, options, scene) The process then modifies a target UV# of the meshes passed with the constructor to make them match the frame of the texture sets. The packer will create a set of "frames" for each unique material and its required texture channels, producing one image for each channel that the materials being packed used. The trade off will be that each texture will be scaled to a set size and might cause some desegregation, there are also webGL limits to take into consideration. A single Material often will use three and often more! To simplify the loading process sometimes it might be convenient to package the texture from multiple materials into a series of images. Some complex scenes will require a large amount of texture. You can see a mesh in wireframe mode by using: materialSphere1.wireframe = true Playground Example - Material Color Reaction to Light Color direct click or edit to view.To give an idea on how the material diffuse color reacts to the diffuse light color the following playground example shows how different color materials react to white, red, green and blue diffuse spot lights. MyMaterial.emissiveColor = new BABYLON.Color3(1, 1, 1) MyMaterial.specularColor = new BABYLON.Color3(0.5, 0.6, 0.87) MyMaterial.diffuseColor = new BABYLON.Color3(1, 0, 1) var myMaterial = new BABYLON.StandardMaterial("myMaterial", scene) Will only apply if the scene ambient color has been set. Set the material color using one, some or all of diffuseColor, specularColor, emissiveColor and ambientColor. This requires an alpha property to be set.Ĭreate a material using var myMaterial = new BABYLON.StandardMaterial("myMaterial", scene) Transparency - the level that you can see through the material can be set and for images with transparent sections it can be used so that appropriate parts of the material are invisible.scene.ambientColor = new BABYLON.Color3(1, 1, 1) Ambient - the color or texture of the material lit by the environmental background lighting.ĭiffuse and Specular material require a light source to be created.Īmbient color requires the ambient color of the scene to be set, giving the environmental background lighting.Emissive - the color or texture of the material as if self lit.Specular - the highlight given to the material by a light.Diffuse - the basic color or texture of the material as viewed under a light.Whether the material is a color or a texture there are different ways it can react to light. One material can be used to cover as many meshes as you wish. Materials allow you to cover your meshes in color and texture and they need light to be seen.
