HugoMcPhee

Members
  • Content Count

    22
  • Joined

  • Last visited

About HugoMcPhee

  • Rank
    Member

Recent Profile Visitors

798 profile views
  1. I'm facing a similar issue but trying to import the glTF File Loader, Would it be okay to include the loaders in the npm package aswell? Or would it be better to have a separate npm repository for the plugins? If making them available through npm isn't an option, Is there some way to import the SceneLoader from the glTF loader? In a es2015 project - glTF loader worked fine following the tutorials ( by including it as a script in index.html) but with a typescript project the same thing isn't working Is there a recommended way to "import" a babylonjs plugin? Thanks
  2. from this post 1. Download http://hugos.site/babylonjs.json and put it in your project folder 2. Get the atom plugin "atom-ternjs" 3. Make a file called ".tern-project" in your project folder and add this { "ecmaVersion": 6, "libs": ["babylonjs"] } 4. Restart atom and It should give you hints if you start writing BABYLON. I personally use this ".tern-project" file: { "ecmaVersion": 6, "libs": [ "browser", "babylonjs" ], "loadEagerly": [ "path/to/your/js/**/*.js" ], "dontLoad": [ "node_modules/**", "path/to/your/js/**/*.js" ], "plugins": { "modules": {}, "es_modules": {}, "node": {}, "doc_comment": { "fullDocs": true, "strong": true } } } because it enables autocompletion when babylonjs is imported like this: import { Scene, Vector3, Mesh } from "babylonjs";
  3. Made this small Rodent exploration game with a friend a little while ago http://mywobsite.x10.mx/indieassignment3/ it uses a flickering kuwahara filter ( tweaked from from https://www.shadertoy.com/view/MsXSz4 ) to try and achieve and oil-paint like effect
  4. Hi I noticed attatching multiple sounds to meshes in blender and exporting it to .babylon using the latest exporter results in an error "Uncaught SyntaxError: Unexpected token {" index.html:202 It's fixed by adding this part " first = False" to near the end of the #Sounds section in io_export_babylon.py # Sounds if len(self.meshesWithSound) > 0: file_handler.write('\n,"sounds":[') first = True for mesh in self.meshesWithSound: if first == False: file_handler.write(',') file_handler.write('{') write_string(file_handler, 'name', mesh.data.attachedSound, True) write_bool(file_handler, 'autoplay', mesh.data.autoPlaySound) write_bool(file_handler, 'loop', mesh.data.loopSound) if hasattr(mesh, 'name'): write_string(file_handler, 'connectedMeshId', mesh.name) write_float(file_handler, 'maxDistance', mesh.data.maxSoundDistance) file_handler.write('}') first = False file_handler.write(']')
  5. Here's a Tern JSON definition file for babylonjs http://hugos.site/babylonjs.json (generated from www.babylonjs.com/babylon.max.js) , (a few "Invalid !type spec" errors were fixed by changing the "!type" of about 10 things to "fn()") ("it's not 100% functioning properly)
  6. Hi Everyone, In babylon.js, loading sounds through nw.js (v0.12.1 windows and linux) wouldn't work. using the same code from the babylonjs audio tutorial: // Load the sound and play it automatically once readyvar music = new BABYLON.Sound("Music", "music.wav", scene, null, { loop: true, autoplay: true });I replaced the filenames with the correct paths and got this error: (if the filename is incorrect it's this error instead: So it seems like the file was loading fine) So I looked at the line that was reporting the error (in babylon.2.1-beta.debug.js) , commented it out, and added the code that runs when there isn't an error, and the sound loaded and played! (using the latest babylon.js 2.1-beta, but the error also happened on babylon.js 2.0 stable) That's the temporary fix I found , I'm not sure what is causing the error, possibly something to do with loading local files? As a side note, The Wav file works, but when I tried an mp3 it gave this error: nw.js is based on chromium which should support mp3 files, so I'm not sure what happened, But for now wav files still work so this is just a quick fix if anyone is having problems with sound in nw.js
  7. These are live backing visuals for a DJ Video streaming site called TRNSMT.tv, the background visuals were shown on a green screen and controlled live made using babylonjs (running in nw.js/node-webkit) The first hour of this video is the babylonjs visuals (it goes pretty slow but skipping through there's a progression of scenes) http://www.dailymotion.com/video/x2nat69_steeplejack-ricci-x-harold-dj-set-hugo-mcphee-x-barnaby-r-w-visuals-wonder-live-initiate-trnsmt_music
  8. I made a wavey ocean effect based on the StandardMaterial by copying the StandardMaterial.js and editing in the vertex shader part of the Wave shader from CYOS. The project is here , The duplicated StandardMaterial.js is called BABYLON.OceanMaterial.js (you can see BABYLON.OceanMaterial.js through right-clicking the game, and picking "Inspect Element" then going to the "Sources" tab in google chrome) I copied the standard material because I needed lighting on the waves, bump mapping worked too which was nice. Although it might make more sense to just make the shaderMaterial using the shaders from standardMaterial (like Delkatosh Suggested)
  9. Instead of trying to use a post process, I just used the fragment shader part (.fragment.fx) from the posteffect in a new "ShaderMaterial" and applied that onto the plane, then I passed the renderTargetTexture to that ShaderMaterial and the effect was the same. Here's what the final code was var kalideMaterial = new BABYLON.ShaderMaterial("kalideShader", newScene, "./kalideMat",{ attributes: ["position", "uv"], uniforms: ["worldViewProjection"]});backBackDrop.material = kalideMaterial;kalideMaterial.setTexture("textureSampler", renderTarget);
  10. I'm trying to show a render target texture on a plane that shows a post processed version of the scene. I can get the render target texture to draw the scene to the plane, but I can't get a post effect to work on it Here's my example code var postProcessConvolution; var renderTarget = new BABYLON.RenderTargetTexture("depth", 1024, newScene,false, true); newScene.customRenderTargets.push(renderTarget); renderTarget.renderList = newScene.meshes; renderTarget.onBeforeRender = function () { postProcessConvolution = new BABYLON.ConvolutionPostProcess("convolution", BABYLON.ConvolutionPostProcess.EdgeDetect2Kernel, 0.7, mainCamera); } renderTarget.onAfterRender = function () { postProcessConvolution.dispose(); }I thought it would apply the process, then render the texture, then dispose the post process. Without the .dispose() the post process is applied to the whole scene every frame. has anyone succesfully done this before?
  11. Yep here's two test scenes that reproduce the error. Although I found it only happens when "Variance" shadows are enabled (from blender), otherwise it works,so it looks like varience shadows are causing the error Here's a scene with two animated object in view: http://mywobsite.x10.mx/armaturetest/index1.html And here's the identical scene with the camera facing away from the animated objectshttp://mywobsite.x10.mx/armaturetest/index2.html This is what the blender setup looks like Here's a zip with all the files (including the blender file) http://mywobsite.x10.mx/armaturetest.zip
  12. In a blender scene one of the character meshes has an armature with an animation. After exporting to a .babylon file and loading it, if the character with the skeleton armature is visible when the scene starts , the animation plays and the scene works as normal, If the camera is facing away from the animated character when the scene starts this error occurs Uncaught TypeError: Failed to execute 'uniformMatrix4fv' on 'WebGLRenderingContext' : No function was found that matched the signature provided.(using nw.js based on Chromium 41.0.2272.76.) This is how the scene is loaded BABYLON.SceneLoader.Load("", "TheBlenderScene.babylon", engine, function (newScene) { newScene.executeWhenReady(function () {It's happened in 3 projects, my current workaround has been to include all the animated meshes in the view when the game starts. Has any one else has had this problem, or have an idea of how to avoid the error? thanks
  13. Hi here's the project with the Depth of Filed cut down to it's depth of field bones, http://hugos.website/DepthOfFieldEffect and the zip file can be downloaded here http://hugos.website/DepthOfFieldEffect.zip (there may be some tweaks that can be made to make it better) I edited the Dof Image fragment shader of this to get it to work http://www.nutty.ca/?page_id=352&link=depth_of_field *Updated* The Dof now uses Babylon 2.0's built in DepthRenderer so the code is a little more simplified, and there's less extra files