NasimiAsl Posted January 26, 2017 Author Share Posted January 26, 2017 about more camera you can define new uniform and use setVector like other customshader Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 26, 2017 Share Posted January 26, 2017 Thanks, BABYLON.Vector.Zero() it is then. Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 27, 2017 Share Posted January 27, 2017 @NasimiAsl Wow, such cool effects! Awesome!!! If you can do such cool fire maybe you can also do explosions? It seems already pretty close: https://www.shadertoy.com/view/XdfGz8https://www.shadertoy.com/view/4tdGzrhttps://www.clicktorelease.com/blog/vertex-displacement-noise-3d-webgl-glsl-three-js -> https://www.clicktorelease.com/blog/vertex-displacement-webgl-glsl-perlin-noise-three-js/add-some-colour-movement I also like those two: https://www.shadertoy.com/view/XttXRshttps://www.shadertoy.com/view/ldKGDh and this light ray for legendary and set drops form diablo 3 http://imgur.com/DC6FqP5 NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 27, 2017 Author Share Posted January 27, 2017 1 hour ago, iiceman said: @NasimiAsl Wow, such cool effects! Awesome!!! If you can do such cool fire maybe you can also do explosions? It seems already pretty close: https://www.shadertoy.com/view/XdfGz8https://www.shadertoy.com/view/4tdGzrhttps://www.clicktorelease.com/blog/vertex-displacement-noise-3d-webgl-glsl-three-js -> https://www.clicktorelease.com/blog/vertex-displacement-webgl-glsl-perlin-noise-three-js/add-some-colour-movement I also like those two: https://www.shadertoy.com/view/XttXRshttps://www.shadertoy.com/view/ldKGDh and this light ray for legendary and set drops form diablo 3 http://imgur.com/DC6FqP5 i can't deny my friend @iiceman challenge i love do that give me time first task : explode iiceman 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 28, 2017 Author Share Posted January 28, 2017 @iiceman 1. Explode without Direction (hover on the mesh ) http://www.babylonjs-playground.com/#1JUXK5#21 this source need refactor i do that after i completed all effect Temechon, JCPalmer, GameMonetize and 1 other 4 Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 28, 2017 Share Posted January 28, 2017 AWESOME! O_O NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 4, 2017 Share Posted February 4, 2017 @NasimiAsl, I did manage to implement my interpretation of a Teleport entrance (final code not yet published / nor scene). There are many mystery areas though to in-part to no code comments / method argument descriptions what so ever. I am just turning knobs in total ignorance. In order to leverage having ShaderBuilder inside QI, I decided to also try to use your explode example in reverse (the explode first, then mesh appears). Going to call it a PoofEntrance. I ran into some problems. I cannot get line 64 to transpile in typescript: .Black(1,BABYLONX.Helper().Solid(color2).Build()) It seems Helper is a class whose constructor returns a new instance of ShaderBuilder. While this transpiles to javascript, constructors are not supposed to return anything. There is no possible syntax I can supply trying to call this. If Helper was made a sub-class of ShaderBuilder, then I could call like: .Black(1, new BABYLONX.Helper().Solid(color2).Build()) I suppose that I could also just ditch the Helper class like: .Black(1, new BABYLONX.ShaderBuilder().Solid(color2).Build()) Is there some reason what little is in Helper could not just be moved to the ShaderBuilder class? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 4, 2017 Author Share Posted February 4, 2017 1 hour ago, JCPalmer said: @NasimiAsl, I did manage to implement my interpretation of a Teleport entrance (final code not yet published / nor scene). There are many mystery areas though to in-part to no code comments / method argument descriptions what so ever. I am just turning knobs in total ignorance. In order to leverage having ShaderBuilder inside QI, I decided to also try to use your explode example in reverse (the explode first, then mesh appears). Going to call it a PoofEntrance. I ran into some problems. I cannot get line 64 to transpile in typescript: .Black(1,BABYLONX.Helper().Solid(color2).Build()) It seems Helper is a class whose constructor returns a new instance of ShaderBuilder. While this transpiles to javascript, constructors are not supposed to return anything. There is no possible syntax I can supply trying to call this. If Helper was made a sub-class of ShaderBuilder, then I could call like: .Black(1, new BABYLONX.Helper().Solid(color2).Build()) I suppose that I could also just ditch the Helper class like: .Black(1, new BABYLONX.ShaderBuilder().Solid(color2).Build()) Is there some reason what little is in Helper could not just be moved to the ShaderBuilder class? i write short struct for c# in this part maybe this can help public static class Shader { public static ShaderBuilder ME {get;set;} // create Child instance public static ShaderBuilder Helper() { // create sub instance var sb = new ShaderBuilder(); sb.Parent = Shader.ME; // change current instance Shader.ME = sb; } } public class ShaderBuilder { public ShaderBuilder Parent {get;set;} public string Body {get;set;} public ShaderBuilder() { /// init first properties or setting // Keep instance in Static holder Shader.ME = this; } public ShaderBuilder Back( string material ) { this.Body += "if(!gl_FrontFace){"+material+"}"; return this; } public string Build() { // change current instance Shader.Me = Shader.Me.Parent; return this.Body; } public string BuildMaterial(scene) { Shader.Me = null; return this.CteateShader(); } } // usage // start instance new ShaderBuilder(). // start sub => change Shader ME to Sub and reverse after Build Sub MAterial .Back( /* sub start */Shader.Helper().Solid().Build() /*sub end */). // Build Final material .BuildMaterial(scene) the static class help a lot for find parent Setting and indexer so i recommend you use that Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 5, 2017 Share Posted February 5, 2017 Thanks, I am not really comfortable actually forking ShaderBuilder, so I will just make my own helper function & continue to use your code unmodified other than uglified & optimized. If I might suggest changing Helper from a class to an exported function, though. You would have to put the statics elsewhere, but not much of a problem except for old code. Here's what I mean: export function Helper() : ShaderBuilder { var setting = Shader.Me.Setting; var instance = new ShaderBuilder(); instance.Parent = Shader.Me; instance.Setting = setting; return instance; } Back to the old code issue, I think the lack of any build/ transpile script in the repo or version being put into at least the js file name is going to cause reluctance for some to add this into their code base. I think I offered add to a Gulp build process, which would transpile, uglify / optimize, create map & d.ts files. Not going back a page to check & possible lose this post, but the offer still stands. NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 11, 2017 Author Share Posted February 11, 2017 i agreed i am working on SB next version and i notice that part thanks a lot Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 12, 2017 Share Posted February 12, 2017 Actually, I ended up only needing one color for 'Poof' entrance. I just removed the helper part needed for the 2nd color. I have not pushed up a demo scene which shows lets you play with all the entrances yet. All the grand entrances are already in the can for QI 1.1, though. Other tweaks needed in different part of extension to do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.