Jump to content

Flake

Members
  • Content Count

    23
  • Joined

  • Last visited

About Flake

  • Rank
    Member

Profile Information

  • Location
    Melbourne, Oz

Recent Profile Visitors

1277 profile views
  1. tl;dr Pause, sleep, resume and wake make for a confusing api initially. Also a master pause (logic and audio) would be handy ( I might have missed this though.) After a longish break of game dev I wanted to take a look at Phaser 3. Loving it so far, (Phaser has come such a long way) but I find the pausing/resuming the entire game(logic, animation, sounds) a little confusing. I'm making a master Pause/Play switch. After game.loop.pause() didn't have the desired effect I've switched to game.loop.sleep and awake(). But I'm unsure if this is the intended use for them. Looking forward to
  2. Sweet! Once again Babylon makes it look easy. Thanks @Sebavan
  3. Hi friends, I searched for a while, but because of the fairly common search terms I might have missed the info I'm looking for in which case I apologies. I want to use seperate/different UVs for diffuse and opacity textures in the StandardMaterial. Is this a thing that is possible, or would I have to modify the source? As always, thanks for using you're precious time to help a pleb like me. let mesh = new BABYLON.Mesh("face", scene); let vertexData = new BABYLON.VertexData(); mesh.material = mat; //set positions, indices, normals vertexData.uvs = normalTextureUVs; vertexData
  4. Thanks @Sebavan & @Deltakosh , I'll think I'll use the official version and put my Frankenstein material to rest.
  5. It worked ^^ I'm not particularly proud of, nor do I fully understand it.. By I copied the relevant ColourCurve code lines out of PBRMaterial and spliced them into the ShaderMaterial. The result is functional, but not elegant. I'll add the .js file. Maybe It's a useful starting point for someone or it can be used of an example of how NOT to do it Thanks again Sebavan ShaderMatWithCC.js
  6. Thank you for you're detailed explanation Sebavan hehe.. I have no 'material code'. I'm using a vanilla BABYLON.ShaderMaterial. I guess I'll try grab the class off github and add a colour curve into it..
  7. Me again.. still messing around with colour correction. Is it possible to bind a Colour Curve to a non-PBM Material? When I attempt the following I get errors: let mat = new BABYLON.ShaderMaterial("mat", scene, "./assets/shaders/blub", { attributes: ["position", "uv"], uniforms: ["worldViewProjection", "globalScale", "globalOffset", "vCameraColorCurvePositive", "vCameraColorCurveNeutral", "vCameraColorCurveNegative"], needAlphaBlending: true }); var curve = new BABYLON.ColorCurves(); curve.GlobalHue = 200; curve.GlobalDensity = 100; BABYLON.ColorCurves.Bind(curve, mat._effect); //
  8. Thanks for the reply guys. Not a direct mix; rather I want to run shaderA and feed the output into shaderB, and render the result of that. I have to take a closer look at your code, but the helperMaterial" looks promising! I'll post an update, once I've gone through the code.. Also the sphere in the third example looks amazing! Edit 1: I could not get the BABYLONX.ShaderBuilder to behave how I wanted. // avrage m1 and m2 .InLine('result = vec4( m2.xyz*0.5 +m1.xyz*0.5 ,0.0);') // when the alpha was zero, the entire mesh was talk transparent and ghostlike
  9. Shaders are still new to me, so this might be a silly question: Is it possible to chain, or merge shaders? I've got a PBRMaterial which uses the ColorCurves, and a custom shader that generates a texture. I'd love to be able to be able to combine or chain them, so I can have both effects. My initial thought was: 'grab the PBRMaterial and Shader from github, and hack in the properties/functions from my custom shader'. But those files have ~2000 lines of code in them, so if anyone knows an easier approach I'd be grateful. Pseudo code, because one can never be too clear W
  10. The cool but also slightly intimidating thing about programming is, that there are so many different approaches one can take to get to the goal. Thanks again Nabroski for the different starting points! In the end I created a shader that mimics Photoshop's Hue, Contrast, Brightness and Saturation settings. It works just the way I wanted. Most of the code was ported from Andrey Postelzhuk's Unity shader. // create the material with default/neutral values // this is then applied to you mesh var material = new BABYLON.ShaderMaterial("colorMatchMat", scene, "./assets/shaders/colorMatc
  11. Heya Nabroski, thanks for the multifaceted response! Unfortunalty lights don't give me the amount of controll I need ( I don't think I can unsaturate mesh with a light) and color curves only apear to work with PBRMaterials I'll look into the Post Processing and post the any results.
  12. Hey everyone, I'm trying to 'color-correct' my scene, and want to adjust the global Hue and Saturation. I came across ColorCurves, but am not sure how to use them. Does this mean I can apply them to the scene, or is this the wrong tool for what I'm trying to accomplish?
  13. Feared as much. And yup, it changes basically every frame. I guess I'll stick to the native vanilla canvas for this project. Thanks again @pongstylin @xerver!
  14. Hi @pongstylin, thx for the reply. Your way works if you want to draw over(or under) the sprite. I'm trying to mix my render order like this. function render (){ graphics.clear(); draw poly draw rect draw image dra line draw rect draw image *about 300 more...}The list chnages dynamically in length, and the positions shift too. That's why I'd like to render the spirte/texture to canvas, instead of adding it as a child.
  15. Hey guys! I've got one main question, with a few follow ups.. here goes I was wondering if there was a way draw an image onto the PIXI.Graphics (object thingy)? I'm aware I can add sprites to the stage and other containers. But I'm currently drawing polygons, and images (with a dynamic render order), So this seems like a good way to do that. Is there a way of doing this, similar to the plain/vanilla canvas way: var canvas = Dom.get('canvas');var context = canvas.getContext('2d');context.drawImage(source, x, y, w, h, ...); I've tried: var context = pixiRenderer.context;.. but this only
×
×
  • Create New...