NasimiAsl

Make Your Wanted Shader In StandardMaterial [ coming soon ]

34 posts in this topic

Sounds cool.

And with ShaderBuilder, we simply add the variable? how does it happen ?

Share this post


Link to post
Share on other sites

let the standardMaterial changes accepted by DK after that i make the the step 2( add shader Builder )

Share this post


Link to post
Share on other sites

Ok, sorry, I want to go too fast, I'm so glad this CustomMaterial :D

Share this post


Link to post
Share on other sites

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 :(

Deltakosh and Dad72 like this

Share this post


Link to post
Share on other sites

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.  :D

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.

:D
 

Share this post


Link to post
Share on other sites

:D 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 

 

      

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

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 like this

Share this post


Link to post
Share on other sites

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 :D ( need define set Texture  and some defines )

jerome and Dad72 like this

Share this post


Link to post
Share on other sites

3 days waiting for finish last part

@Dad72 sorry david i am busy a little i try do it last of this week

Share this post


Link to post
Share on other sites

This is due to the change there was on materials that no longer uses "isReady function".

Share this post


Link to post
Share on other sites

@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...

Share this post


Link to post
Share on other sites
58 minutes ago, javalang said:

if I'm right you are also waiting hard

exactly. He me said probably tomorrow or the weekend :)

Deltakosh and NasimiAsl like this

Share this post


Link to post
Share on other sites

 

:(  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 )

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

i wait one confirm when deltakos is back 

all standardmaterial option is supported i wanna add this for PBR material too 

Dad72 likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.