Jump to content

ShaderBuilder alpha version


NasimiAsl
 Share

Recommended Posts

@NasimiAsl, yes done. Vertex shader are really powerfull ! I knew it, but need a lot of abstraction 

@jerome said  : 

CPU side == easy logic implementation (context data, forces, physics, AI, etc), no multithreaded computations, so less fast

GPU side == ultra fast pure geometry computation, less  or quite no logic handling.

He's right !  I think I succeed to code this vertex shader because I previously coded a cpu 'normal bjs version' of what i need.. So it was 'quite' easy to compare, perform some test, experiment. Firefox shader inspector helps me a lot, for live coding even if sometime I loose time due to 'bugs' firefox or me, sure firefox ! . 

I will put soon a demo online.

 

 

Link to comment
Share on other sites

If the CPU is the "big oven"... the GPU is the microwave oven, eh?  Only use code in there... that is GPU (microwave) -safe, right?  Things cook FAST in there.  heh

Hi guys.  I started doing simple play on the laser scanner PG from Naz (nasimiAsl). 

http://www.babylonjs-playground.com/#1TYWYB#11

This tests the difference of plane vs. ground... when using shaderBuilder materials. 

Using the mydim variable (sometimes "y", sometimes "z"), I was able to adjust the pretty material... so that it properly maps-onto both planes and grounds. 

Just for fun, there is a "fun knob" variable in this demo.  Adjust funknob and hit RUN again... see if you can make Naz's shaderBuilder go insane.  :)  Fun!  Line 53 is where mydim and funknob are used.  Bird poop code.  There is much math in those lines, and that makes it look like a bird pooped there.  :D  It scares my dog, but what is new, there?  My dog is scared of everything.

Yup, shaderBuilder is quite a different approach.  It makes shaders easier to learn, too.  CYOS, shaderStore, and shaders-in-script-tags... they are all good things, too.  ShaderBuilder fits-in nicely.  Our shader toolbox is getting well-stocked with power tools!  That material is beautiful... with all that soft-edge dithering and wonderful curves.  How does it DO that?  It's... magic.  There's a wizard nearby, I just KNOW it.  I can taste the faerie dust in the air.  heh

Can you believe it?  Wingnut, easily doing some shader coding in this playground?  A shader with a fun knob!  That knob could be attached to a cosine animator in the render loop.  I could animate the values of a shader!  ME!  Wow!  I am SO proud of myself (and thanks to Naz, too)! 

I think I will call my mother and tell her what I did. :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...