NasimiAsl Posted March 12, 2017 Share Posted March 12, 2017 with some changes in standardMaterial we can replace custom shader in that and used all light and shadow ,... in that. mix shaderBuilder and standardmaterial http://editor.eash.space/mixedmaterial/ [ in progress ] GameMonetize, Dad72, BitOfGold and 2 others 5 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 22, 2017 Author Share Posted March 22, 2017 http://www.babylonjs-playground.com/#FC4IX#9 first sample Dad72 and adam 2 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 22, 2017 Share Posted March 22, 2017 Sounds cool. And with ShaderBuilder, we simply add the variable? how does it happen ? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 22, 2017 Author Share Posted March 22, 2017 let the standardMaterial changes accepted by DK after that i make the the step 2( add shader Builder ) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 22, 2017 Share Posted March 22, 2017 Ok, sorry, I want to go too fast, I'm so glad this CustomMaterial Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 22, 2017 Author Share Posted March 22, 2017 no worry we do it finally Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 22, 2017 Share Posted March 22, 2017 Validated..but we will need a serious doc NasimiAsl and Dad72 2 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 23, 2017 Share Posted March 23, 2017 @NasimiAsl I start a demo for CustomMaterial with ShaderBuilder. I have not managed yet to make it work, but if it can help. Here is a starting PG for testing. http://www.babylonjs-playground.com/#FC4IX#14 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 23, 2017 Author Share Posted March 23, 2017 i am work on that now i hope finish this in next 10 hours i try to make simple way for use that after that i explain how we can do it and hope @Wingnut or other user help me to write good docs for that ( i am bad in english writing ) GameMonetize and Dad72 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 23, 2017 Share Posted March 23, 2017 I'm scared, and I think ya'll have been power-drinking or something. I haven't understood anything said in this thread, and my dog is whimpering (like he has to go out and pee, and then run away to a new caretaker). You know we have no docs for GeometryBuilder, yet, right Naz? I looked at it once, and said "Oh, I see. This requires a doctoral degree in quantum physics... to understand. You bet, I can write docs for this." Now you are inventing yet another GPU-beating contraption (machine)? And you think a kiddy-level dude like me... can explain to youngsters... sigh... oh goody. Hey, I might speak English, but not advanced calculus. heh. customMaterial, eh? hmm. Interesting. defaultShader is an inbound arg! Not compiled yet? Good ol' ascii text shader code? So, the "custom" function in [line60] can do text replacements to defaultShader code, and append more shader code text onto the bottom of defaultShader... etc. Yes? (the dog just started shivering and whining again) It is a "down-stream hack-festival"... for material shaders. The defaultShader is already in the box, with packing material, almost ready for shipment, and then suddenly... a customMaterial robot enters the box... and changes-around everything, if it wishes. COOL! Of all the unmitigated audacity! SO outlaw, eh? Naz: Hey Deltakosh, can we please make ShaderBuilder part of core? DK: No, it is too weird. Stay out in BABYLONX domain... don't stink-up my core with weirdness. (3 months pass) Naz: Hey Deltakosh... if I use this latex rubber protective lambskin sheath called customMaterial, can I get closer to core? DK: No! Maybe. You're a madman. Fine... but you better have a decent docs writer... or... hmm. Man, this just feels wrong. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 23, 2017 Author Share Posted March 23, 2017 i like your looking way but it is not illegal ( outlaw ) so let i start explain more i simply start answer why,what ,who , when about custommaterial 1. why we need this ? we have standardmaterial with a lot tools depended for scene parameters but have limitation in customized we have shadermaterial with no limitation but dont have any depended parameter with scene ** depended parameters like lights, colors, shadow ... so this is why we need mix and have some thing like standardmaterial with no limitations in some part 2. what is it exactly what do it ? i call it CustomMaterial extended from StandardMaterial but customizable in diffuse color ( for version 1 ) i replace diffuse color in default shader and make new shader 3. who most use it ? ( when we need that ? ) (all people or when we ) wanna make shader material but wanna use all option of standard material ps : dis is not depend for babylonx or shader builder ( but that can help ) i know shaderbuilder is very complicated stuff for core i understand that and respect for DK and think BX is best place for shaderbuilder and geometry builder or others tools Quote Link to comment Share on other sites More sharing options...
javalang Posted March 23, 2017 Share Posted March 23, 2017 @NasimiAsl I cant wait to experiment with CustomMaterial! Though I have some knowledge in writing shaders, I cannot understand all the obviously benefits I've seen so far in the source and playground in detail. So please, if you could provide some docs with the very basic concepts or steps even if the docs are not fine-tuned, this would help me and others a lot. But, I will not stress you, furthermore I'd like to thank you for your effort, greetings, javalang Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 23, 2017 Author Share Posted March 23, 2017 http://www.babylonjs-playground.com/#FC4IX#25 http://www.babylonjs-playground.com/#FC4IX#26 http://www.babylonjs-playground.com/#FC4IX#27 i designed something like this for make that ground.material = new BABYLON.CustomMaterial("s12",function(b){ var name = "newname"; b.varyings = ['varying vec2 vuv;']; b.fragmentUniforms = ['uniform sampler2D tx_01;','uniform sampler2D tx_02;']; b.vertexUniforms = []; b.body = 'result = texture2D(tx_01, vuv ,0.) ;\ result.xyz = result.xyz*0.5 +texture2D(tx_02, vuv ,0.).xyz*0.5 ;\ '; b.vertexBody = ' vuv = uv; '; b.initShader(name,scene); return name ; },scene); @Dad72 i know still without shaderBuilder but wait a few hours more i am so close Dad72 and adam 2 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 24, 2017 Author Share Posted March 24, 2017 http://www.babylonjs-playground.com/#FC4IX#36 http://www.babylonjs-playground.com/#FC4IX#35 http://www.babylonjs-playground.com/#FC4IX#38 test fog for custom material ground.material = new BABYLON.CustomMaterial("s12",function(b){ var name = "def3"; b.initShader(name,scene,new BABYLONX.ShaderBuilder() .InLine('result = vec4( vec3(max(sin(vPositionW.x),sin(vPositionW.z)) ),1.);') .Effect({pr:'min(1.,max(0.,pow(pr,1.3)*13.))'}) ); return name ; },scene); first shaderBuilder mix with custom material still not complete yet ( need define set Texture and some defines ) Dad72 and jerome 2 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 25, 2017 Author Share Posted March 25, 2017 3 days waiting for finish last part @Dad72 sorry david i am busy a little i try do it last of this week Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 25, 2017 Share Posted March 25, 2017 Okay. Thank you. Quote Link to comment Share on other sites More sharing options...
javalang Posted April 6, 2017 Share Posted April 6, 2017 @NasimiAsl Sorry but links throw all an error "Uncaught TypeError: Cannot read property 'reset' of undefined" (test_011.js:1385) Quote http://www.babylonjs-playground.com/#FC4IX#36 http://www.babylonjs-playground.com/#FC4IX#35 http://www.babylonjs-playground.com/#FC4IX#38 test fog for custom material PS: Can't wait, it looks so promising Greetings Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 6, 2017 Share Posted April 6, 2017 This is due to the change there was on materials that no longer uses "isReady function". Quote Link to comment Share on other sites More sharing options...
javalang Posted April 6, 2017 Share Posted April 6, 2017 @Dad72 Oh I see, and this is the reason most of the PG's are not working anymore. Hopefully NasimiAsl is soon on the road again, if I'm right you are also waiting hard... Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 6, 2017 Share Posted April 6, 2017 58 minutes ago, javalang said: if I'm right you are also waiting hard exactly. He me said probably tomorrow or the weekend GameMonetize and NasimiAsl 2 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 6, 2017 Author Share Posted April 6, 2017 why i am busy man but i never give up and do it thanks your wait i see that error i try fix that and you can see the result in old version (2.5 ) Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 7, 2017 Author Share Posted April 7, 2017 i start make that work for both version now Dad72 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 16, 2017 Author Share Posted May 16, 2017 hi all : back to continue CustomMaterial @Dad72 http://www.babylonjs-playground.com/#FC4IX#55 Dad72 and BitOfGold 2 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 16, 2017 Share Posted May 16, 2017 Cool. So it works like that or you plan to streamline your PR awaiting validation? what are the files that we need to update ? CustomMaterial and ShaderBuilder? Is the "fog" also be supported? I suppose yes, everything is merging with StandardMateriel and CustomMaterial. Edite: I try with a more practical demo. But it does not yet work with ShaderBuilder. http://www.babylonjs-playground.com/#FC4IX#57 Nasimi thank you Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 16, 2017 Author Share Posted May 16, 2017 i wait one confirm when deltakos is back all standardmaterial option is supported i wanna add this for PBR material too Dad72 1 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.