• Content Count

  • Joined

  • Last visited

Everything posted by DylanD

  1. but I haven't even recreated the problem yet 😅 Thanks though!
  2. Im using a pixel, however I only ever seem to encounter the problem through my game on mobile. I haven't been able to recreate it yet. Thanks for testing the playground though. I'm still trying to recreate the problem.
  3. Hey everyone, I have a strange problem, when I am playing my game on mobile and I hit and hold a Gui button then slide my finger off of it, the moment I start to slide my finger it seems to call the onPointerUpObservable. This doesn't happen on my computer, and I can't even recreate it in playground for some reason. Im stumped at what could be causing this. Here is a playground to illustrate what I have, but not the exact problem as even in the playground on my phone it would not call onPointerUpObservable: https://www.babylonjs-playground.com/#WYNFSG#2 Any ideas what could be going wrong? im not using hammerjs or any touch plugin since they're only Gui buttons and nothing else. Which seems to work fine on playground. Im not even sure how to label this problem properly.
  4. just a guess, but maybe the camera is too close? Try making the camera a bit farther away. Also if you can try making a playground or put it on a website so everyone can see exactly what you mean.
  5. BOOM! @Pryme8 https://www.babylonjs-playground.com/#2IFRKC#51 the faces things only got me through 4/6 sides, still the left and right faces wouldn't work but, I figured out that if I used the normals from one of my other shaders to figure out what side is what, I could use them to switch between vuv.y and vuv.x!!! LOOK AT THAT!!! WOOOOH!!! shaders are awesome now to make one more with everything all together!
  6. Hey I'm try to do a larger more gradual gradient with my shader but instead of going off of where the camera is I just want it to simply change over the y of the object. When I tried I get It working on only the front face and I'm not sure how to get it seamlessly on all the sides. https://www.babylonjs-playground.com/#2IFRKC#45 Any ideas how I could get it to be seamless ? (shaders are super cool)
  7. Here are some resources that have helped me, for anyone trying to learn. https://thebookofshaders.com http://pryme8.com/procedural-investigations-in-webgl-introduction/
  8. Is it better performance wise, that if I don't need super detailed lights, on majority of my objects, I just make pseudo lights in the shader? Because that is what I did and if so thats awesome! Also how do shaders and lights work together? From my testing it seems that once applied to the object the shader takes priority over the lights and the lights do not impact the object. Oh, @Pryme8 I was wondering what is the best way to debug a shader? console.log("test") doesn't seem to work. Any pro tips?
  9. clones sound good to me(I should test before I post this but no time!), Thanks again @Pryme8 !
  10. oh, I actually didn't think it would make a difference, strange because my standard materials were working with instances, I guess not. xD
  11. well yea the playground you created works great! But I mean when I add it to my games code it does not work.
  12. I know it will, unfortunately its a lot of different scripts and all in typescript, which would be very difficult to put into a playground but, basically I'm using this playground:https://www.babylonjs-playground.com/#2IFRKC#41 Except I have the original mesh boxes making new instances with cube.createInstance(""); Could that be stopping the shader? I also don't have the camera in that specific script... Which might cause that. Im just going to keep updating with things that might be causing it to go blank
  13. Hi there again, although I have the shader I want, I can't seem to get it into my scene, there are no errors, and it will run. However the mesh just does not show up at all. So I must be doing something wrong with copy pasting. I am in typescript. I define the shader under my class. Then in my constructor I initialize the shader with this code var shaderMaterial1 = new BABYLON.ShaderMaterial('', this.scene, { vertex: 'custom', fragment: 'custom', },{ attributes: ["position", "uv"], uniforms: ["worldViewProjection", "time", 'cameraOffset','topColour'] }); shaderMaterial1.setVector3('topColour', new BABYLON.Vector3(0,0.2,1)); then I put it on my mesh with cube.material = shaderMaterial1; None of this shows any errors that I could think of. I don't think this is a problem with the shader, I think it is a problem with my setup somehow. There doesn't seem to need a shaderStore package. I read this doc: http://doc.babylonjs.com/how_to/how_to_use_procedural_textures#using-a-shaderstore-for-shader-storage It seems the only thing I didn't do like the doc was that it is using proceduralTexture, where as I don't I use BABYLON.ShaderMaterial so im not really sure whats going wrong. Any ideas at what my problem could be? I am clueless...
  14. This whole website looks like a good read Thanks il have to read it once I get home!
  15. uh this seems to be blank.. 😐 edit: I think it might just not be loading edit 2: it wouldn't open in safari it opened in chrome though. Sorry I was not very clear, I already have a color that goes through a gradient, I just want to apply the colours that my gradient is at the beginning of every frame or so. So for example, the top colour starts of red and the bottom is black then the red slowly switch to blue and I make the top colour blue. Basically I want to be able to change the colour through my render loop. But I am not sure how to pass a colour through the arguments, I tried here: https://www.babylonjs-playground.com/#2IFRKC#39 but it doesn't seem to work as the bottom colour is black and not green. I thought that passing a Vector3 through to a vec3 would work, but I don't think it is. When I try to do it with Color3 it makes everything red, again even when I set the passed colour to blue or green.
  16. I was also thinking, would there be a way to change the shaders top or bottom colours? I have a nice gradient through all of the colours that I would like to apply to it, not sure if thats possible. Im assuming I would have to do something like: https://www.babylonjs-playground.com/#2IFRKC#39 But that doesn't work... Any ideas on how I could do that?
  17. I was also wondering how expensive performance wise are shaders? If I had 4 of them would that reduce performance for mobile devices?
  18. WOW! These are all really great! This ones pretty much exactly what I need (I think so far) https://www.babylonjs-playground.com/#2IFRKC%2338 I just need it to fade a bit more like this one https://www.babylonjs-playground.com/#2IFRKC%2335 But I can get that much on my own Thanks though @Pryme8 ! You have helped me a lot!!
  19. Hello everyone, I am trying to build what seems to me as a very complex shaderMaterial. Here is what I have so far (actually its mostly @Nabroski 's code, hopefully he know, he's smart!) https://www.babylonjs-playground.com/#2IFRKC#31 I have a list of things I'm trying to do and can't figure out how to do them so I have come to you guys. Here is what I am trying to do, have the shader fade between the two colours, had the height where the two shaders start fading into each other be base off of where the camera is compared to the mesh the shader is on, but I also want it to work on many meshes at the same time so that the fade happens around the same point on screen, but at different points per mesh so that they all look in sync. So: -Fade between the two colours -Height of the colours is based off camera height - specific mesh height -in sync with other meshes In the playground above I set it so that the blocks were at different heights, and the shader is at the same level of each box but different "global' height levels. I want the global height level to be the same, but the meshes height position to be different. Could anybody help with this? This is my first time making a shaderMaterial so I don't really understand it very well, yet. This also might be able to be accomplished with gradient materials but those seemed far less dynamic. So since I need them to be dynamic per mesh I don't think they will work. But I am open to suggestions.
  20. Yes there is, I hadn't noticed it sorry. this is the error: Helpers.ts:144 Uncaught TypeError: Cannot read property 'firstChild' of undefined at Function.e.CleanDiv (Helpers.ts:144) at e.refresh (Inspector.ts:338) at new e (Inspector.ts:228) at t._createInspector (babylon.js:30) at HTMLScriptElement.n.onload (babylon.js:4)
  21. yea that was working for a while but I believe when I switch the 3.3.0-alpha.13 it stopped working il test it some more today. I have so far tested safari and chrome, neither worked. Il update if anything changes.
  22. This is a good idea. But the material I need was actually just the diffuseTexture (mine specifically uses a texture from a server, so less load time I think) of that custom material so I had done clone just because I know it is slightly better to clone than to make a whole new one, so I just ended up cloning before editing the .Fragment_Before_FragColor which lets it work.
  23. He everyone, I'm trying to debug my scene but I can't open the debug layer. I am using Babylonjs 3.3.0-aplha.13 code: scene.debugLayer.show({popup:true}); gives this error The error I get is Please update your browser to open the js inspector in an external view. I am using google chrome but it is up to date, I get the same error in safari which is also up to date. When I switch to scene.debugLayer.show(); It opens but does not show anything except the black layout. Any ideas what I can do to get the debug layer working?
  24. Thanks, this isn't immodestly impacting my progress so no rush, just curious