• Content Count

  • Joined

  • Last visited

Everything posted by MrVR

  1. Hi Guys I was wondering if is posible to have two vew ports in the two sides of the VR camera. @MackeyK24 let me know if you know the answer please let myCamera: BABYLON.FreeCamera = new BABYLON.VRDeviceOrientationFreeCamera("FreeCamera", new BABYLON.Vector3(0, 0, 0), this.scene); this.scene.activeCamera.position, this.scene); myCamera.attachControl(this.engine.getRenderingCanvas()); this.scene.activeCameras.push(myCamera); this.scene.activeCameras.push(this.scene.activeCamera); this.scene.activeCamera.viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0); myCamera.viewport = new BABYLON.Viewport(0.2, 0, 0.2,0.5); I only get this in one side of the left lens do I have to create a third one , I need to have a camera view port inside my vr camera if any body knows how to do it it would be appreciated. thanks
  2. nice cant wait to see it, I have finished putting the materials, post-process and procedural texturing classes into the toolkit with samples and scripts, I will write some docs for these usage soon.
  3. Nice let me know when you have ready or if further help need it, there is feature @MackeyK24 is currently working on suppose, is to export the entire terrain with all its textures but I'm not sure about the status on that.
  4. Hi @Dad72 Exporting the terrain with all included is not possible in the current unity toolkit version; this feature is upcoming in the next version I think. But there are some ways of getting the terrain to work Use the terrain Exporter to get the actual OBJ mesh with out textures then use it on the scene and add textures manually after Second you also can us the scrip BabylonTerrainGenerator component, that will generate a terrain with mountains but no textures assigned you have to chose the textures for the terrain after Or generate the terrain from a mixmap var terrain = BABYLON.Mesh.CreateGroundFromHeightMap("terrain", "heightMap.png", 100, 100, 100, 0, 10, this.scene, false); var terrainMaterial = new BABYLON.TerrainMaterial("terrainMaterial", this.scene); terrainMaterial.mixTexture = new BABYLON.Texture("mixMap.png", this.scene); terrainMaterial.diffuseTexture1 = new BABYLON.Texture("grass.png", this.scene); terrainMaterial.diffuseTexture2 = new BABYLON.Texture("rock.png", this.scene); terrainMaterial.diffuseTexture3 = new BABYLON.Texture("floor.png", this.scene); terrainMaterial.bumpTexture1 = new BABYLON.Texture("grassn.png", this.scene); terrainMaterial.bumpTexture2 = new BABYLON.Texture("rockn.png", this.scene); terrainMaterial.bumpTexture3 = new BABYLON.Texture("floor_bump.png", this.scene); this.mesh.material = terrainMaterial; }
  5. Hey @Deltakosh is it there any info about support for oculus touch control ?
  6. Hey Guys anyone interested in working on the scrips for the UNITY exporter please let me know, I have a few prefabs for particles , camera paths etc , to share on the next version of @MackeyK24's toolkit.
  7. Hey @MackeyK24 This is the best match I got from my STRATUS XL steel series game-pad only those moved the AXIS the others i get not response..
  8. @Sebavan @MackeyK24 Ok I see what your saying I can see there is an entity for the material already that dont have all the properties I want to implement, so babylonPbrMaterial.reflectionTexture = DumpTextureFromMaterial(material,"_ReflectionTexture"); if (babylonPbrMaterial.reflectionTexture != null && material.HasProperty("reflectionTexture")) { var texture = babylonPbrMaterial.reflectionTexture; } BUT when I do it in babylon java-script I do this.hdrTexture = new BABYLON.HDRCubeTexture(this.getProperty('hdrTexturePath',''), this.scene, 512); var custom = new BABYLON.PBRMaterial('custom', this.scene); custom.reflectionTexture = this.hdrTexture; So if I get in the C# code the HDR texture what do I do here to map the HDR texture or Cube map texture to create this.hdrTexture? so I can set the babylonPbrMaterial.reflectionTexture = hdrTexture; from the HDR or CUBE texture in C# or how this would work ocoming from C# to Javascript or TS --- UPDATE Ok I see where the reflection map is done never mind babylonPbrMaterial.reflectionTexture = DumpReflectionTexture();
  9. @MackeyK24 IM getting stock I will look into this tomorrow
  10. MrVR

    PBR Research

    PARAMS FOR UNITY SHADER If some one notice that Im missing any please let me know... @MackeyK24 I'm working on the parameters code for unity, parameter like specular in non-metal materials is not required so I want to make it disable by making templates of the properties that apply disable or enable e.g. non-metal = desable specular map, translucnet : alpha:0.5,. the templates would be non-metal, glossy, translucent..etc I still need to test and figure how to group them up // params list .directIntensity: Controls the amount of diffuse and specular the material is reflecting..emissiveIntensity: Controls the level of emissive light the material is emitting..environmentIntensity: Controls the level of the reflected light from the environment..specularIntensity: As the material is still using a blinn phong like higlights computation, this can help dropping the specular level of the material without impacting the reflectivity..reflectivityTexture= texture;.useMicroSurfaceFromReflectivityMap = true; // in progress.... .reflectionTexture = CubeTexture or HDR Texture refractionTexture .linkRefractionWithTransparency .albedoColor = BABYLON.Color3.White(); .albedoTexture// already in the shader .alpha .indexOfRefraction .useMicroSurfaceFromReflectivityMapAlpha = true; .MicroSurface (AKA Glossiness or specular power) .environmentIntensity: Controls the level of the reflected light from the environment. .specularIntensity: specular highlights .directIntensity = 1.5;// direct dIffuse and specular highlights .wireframe : combine .cameraExposure = 0.9;// photography exposure .cameraContrast = 1.6; .reflectivityColor = new BABYLON.Color3(1.0, 1.0, 1.0); // White to make the material fully reflective..reflectionColor = new BABYLON.Color3(1.0, 1.0, 1.0); // White to make the material fully reflective..OverloadedAlbedoIntensity is to overload a texture with the color the values go from 0 to 1.overloadedAlbedo = new BABYLON.Color3(0, 0, 1);.overloadedAlbedoIntensity = overloadedIntensity;// Creates a reflection texture.// Creates the pbr material to use in the scenevar pbr = new BABYLON.PBRMaterial("pbr", scene);pbr.reflectionTexture = reflectionTexture;pbr.reflectivityColor = new BABYLON.Color3(1.0, 1.0, 1.0); // White to make the material fully reflective. //Allow you to control reflection over transparent surfaces (AKA radiance) pbr.useRadianceOverAlpha = true;glass.reflectionTexture = hdrTexture;glass.alpha = 0.5;// realism reflection fresnel prams to explorematerial.emissiveFresnelParameters = new BABYLON.FresnelParameters();material.emissiveFresnelParameters.bias = 0.4;material.emissiveFresnelParameters.power = 140;material.emissiveFresnelParameters.leftColor = BABYLON.Color3.Red();material.emissiveFresnelParameters.rightColor = BABYLON.Color3.Blue();Camera Control (WTF)Photographic tone mapping and deals with the contrast directly from the material.var pbr = new BABYLON.PBRMaterial("pbr", scene);pbr.cameraExposure = 0.66;pbr.cameraContrast = 1.66;
  11. PBR RESEARCH its amazing what you can do to these pbr materials , light settings, cameras, physics ... First PBR materials test Shader samplers of properties BABYLONJS Features Here is a small reminder of the PBR material supported features: Albedo, Reflectivity, Microsurface Reflection / Refraction Normal Map / Parallax Shadows (as the standard material) Energy Conservation Gamma Correction Inversed squared light Falloff and Light Radius HDR Texture and Seamless Cubemap (LOD extension required) Environment Irradiance Camera controls: Contrast and Exposure Camera controls: Color Grading and Color Curves Zero Light Lighting Debug Controls BABYLONJS PARAMS directIntensity: Controls the amount of diffuse and specular the material is reflecting. emissiveIntensity: Controls the level of emissive light the material is emitting. environmentIntensity: Controls the level of the reflected light from the environment. specularIntensity: As the material is still using a blinn phong like higlights computation, this can help dropping the specular level of the material without impacting the reflectivity. MicroSurface (AKA Glossiness or specular power) reflectivityTexture= texture; useMicroSurfaceFromReflectivityMap = true; useMicroSurfaceFromReflectivityMapAlpha = true; reflectionColor = new BABYLON.Color3(1.0, 1.0, 1.0); // White to make the material fully reflective. OverloadedAlbedoIntensity is to overload a texture with the color the values go from 0 to 1 overloadedAlbedo = new BABYLON.Color3(0, 0, 1); overloadedAlbedoIntensity = overloadedIntensity; // Creates a reflection texture. var reflectionTexture = new BABYLON.CubeTexture("textures/TropicalSunnyDay", scene); // Creates the pbr material to use in the scene var pbr = new BABYLON.PBRMaterial("pbr", scene); pbr.reflectionTexture = reflectionTexture; pbr.reflectivityColor = new BABYLON.Color3(1.0, 1.0, 1.0); // White to make the material fully reflective. The diffuse reflection will be described later in the Environment Irradiance section. Another interesting addition to the reflection is the ability to keep the most luminous part of the reflection over transparent surface... Yeah, it does not make much sense... Actually if you look through a window at night from a lit room, you can see the reflection of lights or TV on the glass. This is the same for reflection in the PBR Material. A special property pbr.useRadianceOverAlpha = true; has been added to allow you to control this effect. Not only reflection (AKA radiance) but specular highlights can be seen on top of transparency. glass.reflectionTexture = hdrTexture; glass.alpha = 0.5; // realism reflection material.emissiveFresnelParameters = new BABYLON.FresnelParameters(); material.emissiveFresnelParameters.bias = 0.4; material.emissiveFresnelParameters.power = 140; material.emissiveFresnelParameters.leftColor = BABYLON.Color3.Red(); material.emissiveFresnelParameters.rightColor = BABYLON.Color3.Blue(); Camera Control Photographic tone mapping and deals with the contrast directly from the material. var pbr = new BABYLON.PBRMaterial("pbr", scene); pbr.cameraExposure = 0.66; pbr.cameraContrast = 1.66; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Roughness: parameter can “flatten” the color transitions. You can use it to make your material appear dusty and flat Reflections: Black color makes the material non-reflective, white color makes it fully reflective. All the gray scale values between increase or decrease the reflection strength Just like with the Diffuse, you can use Color, Bitmap or Procedural map in the Reflect slot. Glossiness: This is the parameter that controls how sharp/blurred are the reflections. Some real world objects, like polished metal, mirror, chrome, have very sharp reflections, while other materials, such as wood, concrete, plastic, etc., have blurred reflections. BABYLONJS //MicroSurface (AKA Glossiness or specular power) BABYLON The micro-surface of a material defines the way it is reflecting the incoming lights. It is not defining the amount, only how. A glossy material will tend to reflect the light in the same direction it is incoming. On a Matte one the reflected light will vary in contact of the surface. Tips: To achieve the best results, you can store the glossiness in the alpha channel of the reflectivity map (this prevents having a constant gloss on one material): materialSphere.reflectivityTexture = texture; materialSphere.useMicroSurfaceFromReflectivityMap = true; Ligthing Intensity In order to allow finer grain control of the lighting, the following properties have been added in the material. directIntensity: Controls the amount of diffuse and specular the material is reflecting. emissiveIntensity: Controls the level of emissive light the material is emitting. environmentIntensity: Controls the level of the reflected light from the environment. specularIntensity: As the material is still using a blinn phong like higlights computation, this can help dropping the specular level of the material without impacting the reflectivity. Fresnel changes the reflection strength depending on the viewing angle. General rule is that reflections are weaker if the surface is facing you perpendicularly and increase in strength as the surface approaches parallel position relative to your viewing angle. As a general guideline, here are the Reflect IOR values for some common object types: water 1.33 plastic 1.45 glass 1.5-1.8 diamond 2.4 compound materials like wood, stone, concrete etc 3-6 metals 20-100 Reflection Depth: This is the number of times a light ray is reflected before stopping the calculations. When the set number of reflections has been calculated, the rest are simply displayed as the Exit color. You can try setting a bright color as the Exit color to see how much information you lose. BABYLONJS Reflectivity (AKA specular color) The reflectivity of a material defines the amount of light it is reflecting. Basically, a black specular will mean almost no reflection and white will be close from a perfect mirror: Tips: To achieve the best results use a specular map stored in a texture: materialSphere.reflectivityTexture = texture; Reflection The key purpose of a PBR material is to conserve the energy (not emitting more light than it receives). If a lot of light is reflected from the environment the diffuse reflected light will drop. This means that without Reflection Map the material would be black if the specular is close to white (reflecting nothing). This is why we introduce in the material a Reflection Color parameter to ensure the material still works without Reflection texture. var pbr = new BABYLON.PBRMaterial("pbr", scene); pbr.reflectionColor = new BABYLON.Color3(1.0, 0.0, 0.0); Refractions: These settings control if and how the material let’s the light through it. Common materials that have refractive properties are glass, water, gems, transparent plastics, etc. First parameter that controls the refractions is Refract color. As before, it goes from black (no refractions) to white (full refractions) and everything in between is a mix between Diffuse and Refraction. OverloadedAlbedoIntensity is to overload a texture with the color the values go from 0 to 1 materialSphere.overloadedAlbedo = new BABYLON.Color3(0, 0, 1); materialSphere.overloadedAlbedoIntensity = overloadedIntensity; Refraction glossiness: Just like with the reflections, you can change how blurry are the refractions. This effect is great for frosted glass or any other rough surface that lets through the light but distorts it along the way. This one increases render times and noise a lot so be careful with it. No need to go lower than 0.6 for most materials. INDEX of REFRACTION: has been calculated for many materials, so you don’t need to guess. You can find various IOR tables on the internet. Here is one of them: Acetone 1.36 Actinolite 1.618 Agalmatoite 1.550 Agate 1.544 Agate, Moss 1.540 Air 1.0002926 Alcohol 1.329 Amber 1.546 Amethyst 1.544 Crystal 2.00 Diamond 2.417 Emerald 1.576 Ethanol 1.36 Ethyl Alcohol 1.36 Glass 1.51714 Glass, Albite 1.4890 Glass, Crown 1.520 Glass, Crown, Zinc 1.517 Glass, Flint, Dense 1.66 Glass, Flint, Heaviest 1.89 Glass, Flint, Heavy 1.65548 Glass, Flint, Lanthanum 1.80 Glass, Flint, Light 1.58038 Glass, Flint, Medium 1.62725 Gold 0.47 Ice 1.309 Ivory 1.540 Jade, Nephrite 1.610 Jadeite 1.665 Lead 2.01 Malachite 1.655 Methanol 1.329 Moonstone, Albite 1.535 Nylon 1.53 Onyx 1.486 Opal 1.450 Oxygen (gas) 1.000276 Oxygen (liq) 1.221 Pearl 1.530 Plastic 1.460 Plexiglas 1.50 Polystyrene 1.55 Quartz 1.544 Quartz, Fused 1.45843 Rock Salt 1.544 Rubber, Natural 1.5191 Ruby 1.760 Sapphire 1.760 Silicon 4.24 Steel 2.50 Tiger eye 1.544 Topaz 1.620 Tourmaline 1.624 Turpentine 1.472 Turquoise 1.610 Water (gas) 1.000261 Water 35’C (Room temp) 1.33157 Zirconia, Cubic 2.170 Max depth works just like with the reflections. The default value is usually fine, but for scenes with large amount of refractions, you should increase it. Fog Color. It is great if you want to tint the glass in a realistic way. Using the Fog color makes thinner parts lighter and thicker parts darker. You can use the Fog multiplier value to adjust how strong is the tint. I suggest using colors with less than 255 lightness and saturation for realistic results. You can control the relationship between object thickness and Fog intensity by using the Fog value. Look at the examples to see how it works. Negative values make the tinting stronger and color transitions more extreme, while positive values make the fog smoother and weaker. Use it together with fog multiplier to get the effect you need. The biggest drawback of the Fog color is that you can not use a map in this slot, this means you can only use a single color. If you want to create a stained glass material or glass with multiple colors, you will have to do that by using the Refract color and not the Fog. It is, however, great for those single-colored materials and much more realistic than simply changing the Refract color. Anisotropy allows you to create stretched highlights. In real world these are most commonly seen on brushed metal surfaces with long, parallel ‘scratches’. Anisotropy allows you to fake this by stretching and rotating the highlights as you like. Bump and Displace slots first. Both of these slots allow you to assign a bitmap or procedural map to simulate unevenness and deformation of the objects surface. Bump does so without changing the overall geometry of the object, but Displace actually subdivides and deforms the object during rendering. The deformations work like this – middle grey [128;128;128] of the map does not change anything on the object, darker values push the surface inwards while lighter values pull it out. The further this value is from medium gray, the stronger is the effect. Color of the map is not taken into account and only the lightness value is used. Last map we are going to look at is the Opacity map. It works very simple. Pure white value is used for the non-transparent parts of the material and pure black is for completely invisible parts of the material, everything in between is more or less half transparent. It is great if you need to simulate stuff like tree leaves or lace fabric without using a large amount of polygons. BRDF DOCS ~ref: ~ref: ~ref: ~ref:
  12. Guys I think I'm working all over the place so, -I'm going to be working integrating natively on unity all the new stuff for PBR materials. I have a bunch of new options to create stunning PBR materials that I have to test Then we can create real exportable material libraries like @MackeyK24 suggested -I want to create something similar as the PBR shader for the particles system and the solid particle system (SPS to break glass ,walls etc physics effects ). It take me long time to design any particle because I have to play moving the values for the particles and deploy it to see how it looks like, moreover, I think we should create something we can modify a run time or Is there a way or a particle creator software, (besides the playground), I can use to do my particles?? other wise I suggest let create one native for Unity. - I think @mackey24 already work on the camera rig controls and the sky box I'm waiting for the code to be finish to test this features, Hey Mackey please dont forget to put the VR camera I'm anxious to tested je je
  13. Hey @MackeyK24 Nice work on the HDR sky box, Just a few things to point out 1. On the Main Camera, You have the HDR check box, Is this to activate or deactivate the HDR sky-box, and to change the HDR properties (Exposure Luminance etc). 2. then on the scene-controller you have the SKY BOX texture, and in the \ 3. Light/Scene you have the HDR MAP and the REFLECTION MAP - Why we dont put it all in the Scene controller because is confusing setting it up in all these three different places dont you it possible? About the PBR materials I totally get what your saying to make them serialized when exporting the metadata, Don't worry I will take care of that, I will re-watch the video again tonight and I will let you know If I need your help, but I think we need to talk and agree in some stuff for example. I think your going this way, If I put the PBR options from my script on the PBR materials then I will use the PBR material Shader options to create exportable PBR materials , Instead of pre-setting values in code for metal, wire, glass, wood etc, so in this way we can share a material library with real material and no code to create them. I want to finish the materials workflow, and I will do the same for the particle system, I need a way to create multiple particles but I want some presets to have an start point, e.g (laser beans, starts , light saber, bubbles, fire, smoke etc ) tif you have any nice particles done please share the parameter with me thanks. DO YOU KNOW if I can use video clips as texture on an empty game Object for example this video for a video texture I will look into video textures material and see
  14. @MackeyK24 I think we should make also the reflection HDR texture optional per material because the reflections map combine with the reflectivityTexture, albedoTexture is what it makes the power to create multiple materials I dont know if a normal texture is available for PBR but that it would be amazing to have with a range input to scale the BUMPINESS on the normal texture for PBR NO BUMPINESS MAP NEGATIVE BUMPINESS -150%BUMPINESS MAP 100% ALSO Can you please add this options REGULAR PBR we can turn on the border (GLOW), the WIRE-FRAME on and the last one I increase the fresnel and I get a better wireframe etc... I have more option in review.. What do you think @MackeyK24 HERE is the sample of many combinations of HDR, wire, and different textures
  15. Hey @MackeyK24 Im reading and if I understand well, you will be able to setup an hdr sky reflection texture individually on the PBR material not matter if the skybox is setup , hdr, or regular?, thats why on my script for the hdrskybox is separate from the PBR material so I can chose my own HDR texture or by default the current skybox if it is HDR - I'm currently working PARTICLES systems, (let me know if you need me for the PBR), I want to predefined some laser, bubbles, starts. etc effects if you now sample code or library I can use please let me know otherwise I keep doing as try and error to see what I get. I have many questions about this we should get a separate tread for Particles Systems
  16. I get full 60 FPS but the controls are too hard to use is not responsive in my Samsung galaxy S7
  17. Thanks Senor @davrous that function will come in handy for my procedural city scene. In the mean time I made this tutorial in how to import a character into unity 5 , I hope one day we can export animated characters from unity to Babylon @MackeyK24
  18. Nice I get 60 FPS and some time is like looping a 47 FPS freeze for a millisecond, I try with my Xbox one control and its not working but if you use the camera that is already attached I think it should move with your fingers and the game pad I'm not sure
  19. @davrous I was reading the tutorial for the optimization but I can not find the How to merge meshes. function, the link takes me to the Babylon GitHub not o the function, can you please provide the link thanks. ---UPDATE I dowload the project and I found the function please correct me if I'm wrong but I think is this one var mergeMeshes = function (meshName, arrayObj, scene) { var arrayPos = []; var arrayNormal = []; var arrayUv = []; var arrayUv2 = []; var arrayColor = []; var arrayMatricesIndices = []; var arrayMatricesWeights = []; var arrayIndice = []; var savedPosition = []; var savedNormal = []; var newMesh = new BABYLON.Mesh(meshName, scene); var UVKind = true; var UV2Kind = true; var ColorKind = true; var MatricesIndicesKind = true; var MatricesWeightsKind = true; var i; var it; var ite; var iter; for (i = 0; i != arrayObj.length ; i++) { if (!arrayObj[i].isVerticesDataPresent([BABYLON.VertexBuffer.UVKind])) UVKind = false; if (!arrayObj[i].isVerticesDataPresent([BABYLON.VertexBuffer.UV2Kind])) UV2Kind = false; if (!arrayObj[i].isVerticesDataPresent([BABYLON.VertexBuffer.ColorKind])) ColorKind = false; if (!arrayObj[i].isVerticesDataPresent([BABYLON.VertexBuffer.MatricesIndicesKind])) MatricesIndicesKind = false; if (!arrayObj[i].isVerticesDataPresent([BABYLON.VertexBuffer.MatricesWeightsKind])) MatricesWeightsKind = false; } for (i = 0; i != arrayObj.length ; i++) { var ite = 0; var iter = 0; arrayPos[i] = arrayObj[i].getVerticesData(BABYLON.VertexBuffer.PositionKind); arrayNormal[i] = arrayObj[i].getVerticesData(BABYLON.VertexBuffer.NormalKind); if (UVKind) arrayUv = arrayUv.concat(arrayObj[i].getVerticesData(BABYLON.VertexBuffer.UVKind)); if (UV2Kind) arrayUv2 = arrayUv2.concat(arrayObj[i].getVerticesData(BABYLON.VertexBuffer.UV2Kind)); if (ColorKind) arrayColor = arrayColor.concat(arrayObj[i].getVerticesData(BABYLON.VertexBuffer.ColorKind)); if (MatricesIndicesKind) arrayMatricesIndices = arrayMatricesIndices.concat(arrayObj[i].getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind)); if (MatricesWeightsKind) arrayMatricesWeights = arrayMatricesWeights.concat(arrayObj[i].getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind)); var maxValue = savedPosition.length / 3; arrayObj[i].computeWorldMatrix(true); var worldMatrix = arrayObj[i].getWorldMatrix(); while (ite < arrayPos[i].length) { var vertex = new BABYLON.Vector3.TransformCoordinates(new BABYLON.Vector3(arrayPos[i][ite], arrayPos[i][ite + 1], arrayPos[i][ite + 2]), worldMatrix); savedPosition.push(vertex.x); savedPosition.push(vertex.y); savedPosition.push(vertex.z); ite = ite + 3; } while (iter < arrayNormal[i].length) { var vertex = new BABYLON.Vector3.TransformNormal(new BABYLON.Vector3(arrayNormal[i][iter], arrayNormal[i][iter + 1], arrayNormal[i][iter + 2]), worldMatrix); savedNormal.push(vertex.x); savedNormal.push(vertex.y); savedNormal.push(vertex.z); iter = iter + 3; } if (i > 0) { var tmp = arrayObj[i].getIndices(); for (it = 0 ; it != tmp.length; it++) { tmp[it] = tmp[it] + maxValue; } arrayIndice = arrayIndice.concat(tmp); } else { arrayIndice = arrayObj[i].getIndices(); } arrayObj[i].dispose(false); } newMesh.setVerticesData(savedPosition, BABYLON.VertexBuffer.PositionKind, false); newMesh.setVerticesData(savedNormal, BABYLON.VertexBuffer.NormalKind, false); if (arrayUv.length > 0) newMesh.setVerticesData(arrayUv, BABYLON.VertexBuffer.UVKind, false); if (arrayUv2.length > 0) newMesh.setVerticesData(arrayUv, BABYLON.VertexBuffer.UV2Kind, false); if (arrayColor.length > 0) newMesh.setVerticesData(arrayUv, BABYLON.VertexBuffer.ColorKind, false); if (arrayMatricesIndices.length > 0) newMesh.setVerticesData(arrayUv, BABYLON.VertexBuffer.MatricesIndicesKind, false); if (arrayMatricesWeights.length > 0) newMesh.setVerticesData(arrayUv, BABYLON.VertexBuffer.MatricesWeightsKind, false); newMesh.setIndices(arrayIndice); return newMesh; };
  20. Hey @MackeyK24 the game is coming up nice je je I get 60 FPS as well on the game, On my scene I put more particles emission plus a volumetric light scattering and I still get 60 FPS but I thinkthis depends on the computer I'm not sure here is my working in progress scene here is the same scene with out the particles and light but on my Samsung galaxy S7 take forever to load VR CAMERA SET UP To test the VR camera you can use this code snipped inside your SceneBuilder component and to test on your phone you just connect to the app using the computer IP address:PORT number you must be in the same network on your phone as the computer in my case my localhost:8888/ in my phone is and then you can move the vr camera on your phone /* Babylon Scene Controller Template */ /* <reference path="{*path*}/Assets/Babylon/Library/babylon.d.ts" /> */ module PROJECT { export class SceneController extends BABYLON.SceneController { public ready() :void { // Scene execute when ready this.scene.activeCamera.attachControl(this.engine.getRenderingCanvas()); } public start() :void { // Start component function var myCamera :BABYLON.FreeCamera = new BABYLON.VRDeviceOrientationFreeCamera("FreeCamera", new BABYLON.Vector3(0, 0, 0), this.scene); myCamera.speed = 3; // myCamera.wheelPrecision = 250; myCamera.fov = .8; // myCamera.position = this.scene.activeCamera.position; myCamera.position.z = this.scene.activeCamera.position.z - 0; this.scene.activeCamera = myCamera; this.scene.activeCamera.attachControl(this.engine.getRenderingCanvas()); } public update() :void { // Update render loop function } } }
  21. @ragingclaw but do this works also with skeleton animations? , cause when I look for the animations mines are empty?? but if I run the this.scene.beginAnimation(skeletons[0], 200, 635, true, 1.0); then it works yes I think I get it, for example the way I was doing it is to import the mesh and get the skeleton to be animated from certain frame to another but I will look into this looks way easier to control .
  22. is this only too loop the animation or also to play the animation? so for example if you have multiple animation in one mesh, you can access each animation by index and play it or you use the frames to play the animations from one frame to another where all the animations are in different frames??
  23. @ragingclaw try putting this code at the end of the Babylon file where your animation ends ,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":1521,"indexStart":0,"indexCount":6540}], // add this code for the animation loop "autoAnimate": true, "autoAnimateFrom": 200,// from what frame to what frame "autoAnimateTo": 700, "autoAnimateLoop": true// loop ,"instances":[]}
  24. Hey that little Asteroids game is awesome je je @MackeyK24. OK so to access any property you can create your own access class around the API, but like @ragingclaw asked, if you want to share the Babylon file, will you be able to access the API? if you load the scene in java-script using for example BABYLON.SceneLoader.Load("assets/3D-M-LBRY/mesh/", "playground.babylon", engine, function(scene) { scene.executeWhenReady(function() { BABYLON.SceneLoader.ImportMesh(name, "Assets/babylonreadyfiles/", imageFileName, scene, function(newMeshes, particles, skeleton) { So you can make little API access per scene if you wish to make it more organized.
  25. humm the only thing I can think of is creating some sort of abstract class that maps the metadata porperties, but I dont think there is another way for now. I though I can build multiple scenes and load them o demand using angualar modules, but it would be nice if you can re use the classes..