Jump to content

The Wingnut Chronicles


Wingnut
 Share

Recommended Posts

Every time i return back in this thread i got a feeling i got to read through and essay of Ernst Hemingway 

But i keep tracking what you're guys are doing - very interesting.

@Nockawa
I lost the red line, didn't you want to implement a kind of global resize function.

i solved this click-thru-issue like 5 months ago.

resizing every single element is that what hurts (typing). would be great if i could put everything in a group and from their everything would be automated. But maybe its already exists ? 

http://babylonjs-playground.com/#1XTOCQ#0

Link to comment
Share on other sites

On 10/22/2016 at 3:07 AM, Nabroski said:

Every time i return back in this thread i got a feeling i got to read through and essay of Ernst Hemingway 

But i keep tracking what you're guys are doing - very interesting.

@Nockawa
I lost the red line, didn't you want to implement a kind of global resize function.

i solved this click-thru-issue like 5 months ago.

resizing every single element is that what hurts (typing). would be great if i could put everything in a group and from their everything would be automated. But maybe its already exists ? 

http://babylonjs-playground.com/#1XTOCQ#0

The designSize feature was implemented to let you specify a fixed size Canvas and then fixed position, and then I take care of scaling Primitives based on the "real" canvas size. I should have create some overview documentation about it.

For instance  you may create a canvas with a design size of 640*400, then position/size primitives according to this size. If the canvas' real size is 1280*800, then I will apply a internal scale factor of 2, for you to have the expected render.

Is this what you're talking about?

 

The click thru issue couldn't be done few months ago, correct. and I fixed it. but now I've made it the default behavior (to prevent click thru) and added the ability to disable this default behavior.
It's not much for the programmer to disable click thru, but as a always: when you know what to do, otherwise  you might spent couple of hours to figure it out.

 

Link to comment
Share on other sites

On 10/21/2016 at 8:07 PM, Nabroski said:

i solved this click-thru-issue like 5 months ago.

:)  I think perhaps Nabs solved the click-thru (for HIS tests) because he understands the observer system well, and knew how to "discriminate" between a canvas2D click and a mesh click.  Maybe we can talk Nabs into writing an observers tutorial... even in a different language.  I would be glad to translate to English, as needed.  There might be great Observers-for-JS tutorials that already exist on the web.  I should read one.  heh.

Interesting info about prim scaling based on design size, Nox.  Thanks!    Yep, you are correct with "when you know what to do", too.  I didn't know where the eventState object was located, nor what its purpose was.  Now we know more.  It is 's'  :) 

Btw, Nabs... weird demo... with the tetrahedron and text scroll.  Interesting, though.  You certainly optimized the bgen() function quite well.  (It got more 'regexp-looking')  heh  Lines 14-18 of that demo... are regexpy, too.  :)  COOL CODE!   EdgesRender mixed-with highLight layer, too.  Nice.

Sorry for all the talking... but I love doing it... imagining future issues and uses for Canvas2D. 

We're still awaiting a winner in the "Replace The Scene Pointer With A Sprite2D" contest.  I wonder who will win?  ;)  Extra credit for making 3 sprite2D for the pointer.  One pointer when no mouseOver, another for mouseOver mesh, and another for mouseOver Rect2d menu buttons.  WOW!

Link to comment
Share on other sites

10 hours ago, Wingnut said:

:)  I think perhaps Nabs solved the click-thru (for HIS tests) because he understands the observer system well, and knew how to "discriminate" between a canvas2D click and a mesh click.  Maybe we can talk Nabs into writing an observers tutorial... even in a different language.  I would be glad to translate to English, as needed.  There might be great Observers-for-JS tutorials that already exist on the web.  I should read one.  heh.

Interesting info about prim scaling based on design size, Nox.  Thanks!    Yep, you are correct with "when you know what to do", too.  I didn't know where the eventState object was located, nor what its purpose was.  Now we know more.  It is 's'  :) 

Btw, Nabs... weird demo... with the tetrahedron and text scroll.  Interesting, though.  You certainly optimized the bgen() function quite well.  (It got more 'regexp-looking')  heh  Lines 14-18 of that demo... are regexpy, too.  :)  COOL CODE!   EdgesRender mixed-with highLight layer, too.  Nice.

Sorry for all the talking... but I love doing it... imagining future issues and uses for Canvas2D. 

We're still awaiting a winner in the "Replace The Scene Pointer With A Sprite2D" contest.  I wonder who will win?  ;)  Extra credit for making 3 sprite2D for the pointer.  One pointer when no mouseOver, another for mouseOver mesh, and another for mouseOver Rect2d menu buttons.  WOW!

thanks @Wingnut very much. I'm modelling my house model, i have to add many light map for my house. And I very happy for your help. I'll use your source code for my app.!

Link to comment
Share on other sites

@Nockawa


if think i solved it
by checking the string match the id if and event recived and the id matches with the button then do something  
if else thing, basic programming, i think im a programmer, you don't have to do anything, this is crazy, i realize this. 
kind of
http://babylonjs-playground.com/#1XTOCQ#2


if you program something it should simply my life. writing pur webgl should be more timeconsoming


SIZE IDK make something just Awesome. I think you on the right way. :)

Link to comment
Share on other sites

Hi @thiendv!  Hey, did you start reading at ...

Lots of posts happened since we started, eh?  I hope you were able to follow-along okay.  Does the right-click menu open/close correctly, for you?  Does the b0Service button (random color change) work okay?  I hope so. 

If you have problems or questions, just ask.  http://www.babylonjs-playground.com/#BUWYF#42 is the latest version of the right click menu.  @Nockawa and @Nabroski helped too, as you can read... and read... and read.  heh.  It was a fun challenge... I enjoyed it.  Good luck on your house project!

Link to comment
Share on other sites

http://www.babylonjs-playground.com/#1M67K8#16

Raanan's cloth simulator is just... so so so so magical.  Drool.

A little while back, @Dad72 was asking for "soft body" examples... and I was surprised to see @Deltakosh point-out this demo.

Then i got to thinkin'... "What IS a softbody?"  Can a pillow be "assembled"... IF the correct physics joints are applied to a mesh?

Wobblies, v1.0. 

I think Dad72 was looking for a pillow-like thing.  All in all... what a superb playground, eh?  I love watching it.  Thx, textile-master @RaananW

What's that?  Wanna get a bit demented?  Ok...  http://www.babylonjs-playground.com/#1M67K8#17

Wobblies!  :)

Link to comment
Share on other sites

Hi guys!

Recently, I decided to "borrow" a rounded-edge mesh from this cool demo... and use it as the basis of a button.  Using our now-familiar ScreenSpaceCanvas2D, (with child menu_grp, with child menu_rec, with child rect2D button, with a Text2D child label)... I tried to match corner radii and... make a decent button.  :)

http://www.babylonjs-playground.com/#14VFYX#4

Although these superello shapes take quite a bit of code to dynamically generate, I think they are candidates for the shapes of future Button3D... for the Canvas2D system.  I dunno if Button3D is a proper thing to have available in the canvas2D system... but I still wanted to see how they look.  :)

According to debug layer... the superello mesh and its wireframe twin... use 14700 verts.  So, the end-result button will have about 7350 verts.  Perhaps that is a bit heavy for a single button.  :)

Let's now torture our trackNode... mister superello shape...

http://www.babylonjs-playground.com/#14VFYX#5

As you can see, I forgot that screenSpaceCanvas2D are "billboarded".  So, although a ssc2d positionally-tracks the trackNode set in line 75, they do not track superello, rotation-wise.  I should have used a WorldSpaceCanvas2D, eh?  Wingy is not too bright sometimes.  :)

Also, something is wrong with my mouse... after button click.  It gets drunk or something.  :o

 

Link to comment
Share on other sites

The Tracked Node feature was designed this way, it made more sense to me back then and it's still is but it's true some features could be added to enable things like scaling/rotating according to the tracked node.

Why you don't use a Rectangle2D with a Rounded Radius, border, fill, using solid or gradient brush, it would cost less in term of vertices and rendering for sure! :)

 

Link to comment
Share on other sites

Hi N, thx for the comments/info, and I agree with the cost comment, but... this is testing a rather fancy menu.  It uses lighting effects... specular highlights... trying to gain some of the "delicious frosting" that comes with a round-edge mesh.  Yeah, it's pretty ridiculous... but that's what I am after... this time.  :) 

I want a big, fluffy, sofa-cushion, Roger Rabbit-grade... happy bedazzler menu... nearly full screen. 

Are those wsc's and rect2d's... ready to handle curved surfaces?  Probably only the customWorldSpaceCanvasNode can be "painted onto" a curved surface, and match contour (if even that).  Likely, no curve contour-matching (uv mapping) can happen... with the parenting method I am using.  With parenting, the wsc and its children... will be flat. 

CAN a wsc2D be used as a texture on a sphere (bend to follow curve contour)??  hmm.  :)  Anyway, back on-topic.  :)

This menu, in practical use, would live in its own dedicated scene.  It is allowed to be heavy.  There will be moving lights, and animation on the mesh, AND perhaps animation on the Sprite2D shapes that are on each side of the text2D label!  WOW! 

Readers, let it be known... that animating the WorldSpaceCanvasNode is quite easily done, as well.  As Nockawa states... this can be done just fine with a round-corner-border rectangle2D... including all animation... and for a lot less vert-count than what I am trying.  Kids, do NOT try this goofy Wingnut experiment... if you want performance.  Wingnut is going to "pig out" on this campfire test.  :D

There is a (slim) possibility that its buttons will have physics.  YIKES!   Each button might "hang" from two physics links extending down from the button above it!  Wow!  They might blow in the wind, a little.  Coooooool!  Did anyone notice that I found fascination in the "link chains" or "chains of joints" seen in Raanan's cloth demo, recently? (Get real, Wingy!  Nobody reads your crappy forever-thread.) :)

Buttons can "dangle" from chains of joints, too.  Yum!  heh

I guess this "thing" I'm doing... is called a "custom worldSpaceCanvasNode".  (see line 9).  I didn't activate a customWorldSpaceCanvasNode in my demo.  I just parented the standard WorldSpaceCanvasNode... to the superello mesh.  Both ways, work... I suspect.  BUT... notice that Nockawa's customWorldSpaceCanvasNode PG demo (above link)... uses Jerome's faceUV 6-pack of parameters.  That is used for putting a different texture on each of 6 sides of a box.  When trying a sphere... it is a whole new ballgame.  

http://babylonjs-playground.com/#EPFQG#8  (not yet operational, but ready for a genius like Nockawa [or anyone else] to show us how it is done, IF it IS possible.)  (wink, wink)  WorldSpaceCanvas2D as a texture for a sphere?  What a ridiculous thing to imagine-up, eh?  :)  I think that would require canvas2d.convertToDynamicTexture()... likely possible.

--------------

I wonder...  hmm... I don't know if I have ever tried to put a standardMaterial with diffuseColor/texture... on a .worldSpaceCanvasNode.  I wonder what it does.  :)   Let's try it... by activating line 78 - http://www.babylonjs-playground.com/#14VFYX#8

Its yellow color... over-rides a few other colors... such as menu_rec's border color, and it somehow affects button colors that were set in lines 117-124.  Interesting.  The wsc's green backgroundFill is affected, as well.  It caused it to "mostly" disappear, except for some areas around the text.  Even MORE interesting!

--------------

Anyway, this latest PG is my attempt to convert-to worldSpace version.  I'm struggling with some things, but, it is all part of the fun.  I have been trying to avoid using any "scaling" and am using sizing, alone.  I don't even know if scaling is available on any of these things, but I bet worldSpaceCanvasNode allows scaling. 

Don't expect the button (what you can FIND of it) to be clickable.  WorldSpaceCanvas2D requires no group2D (for tracking a node)... so its hierarchy changed.  When that happened... its eventData.relatedTarget.parent.etc.etc... changed (used in lines 128-131)... and I haven't updated those, yet.  b0Service func will fail, in this work-in-progress.  No big deal.  We're still working on "layout".  Functionality comes later.  :)

Link to comment
Share on other sites

Hi gang.  I'm off on yet another trail.

  I have been working to get @Luaacro or anyone... to help me get godrays (volumetric light scattering/VLS) to work correctly on particle textures.  (A long time ago, it worked.)

Then I thought... well hell Wingy... YOU should try to get it working yourself.  SO, off I went. 

First, when hacking source code, I like to bring the hacked system... into the playground.  I did that.  The entire VLS system (minus any shader)... is in lines 2-360 of this new demo:

http://www.babylonjs-playground.com/#1WQCSF#6

Yeah, I know.  Things got out of control.  Why I needed the 3 mirror tiles, I really don't know.  heh. 

But there we go... "Bonehead", our beloved skull model... is all godray'd-up with godrays1 system.  The particle system (lines 464-494) is active, and it's particle emitter named "sprayer"... is used in godrays2 system (for no real reason).  Its blue cube is emitting godrays, though weaker godrays than bonehead.

No camera target is set, so feel free to control-drag the default arcRotate target.

And, of course, thoust shalst not see godrays in the mirrors... cuz... godrays is post-process.  Godrays happen "down-stream" from the mirrors, and mirrors likely use renderTargetTextures (rtt).

And then there's line 408.. a magic line that I discovered in the early days of VLS.  (Back when Luaacro first activated a VLS post-process for us, a very kind thing for him to do!  It's excellent!  Great effect!)  I'm not sure what line 408 does, but it sure is professional-looking, eh?  ;)  (and it could be apropos to our VLS-on-particles challenge.)

So, here we are.  Anyone want to "run-with" this?  We (I) am hoping-for Godrays emitting-from the particles/particle-textures. 

I am quite sure that it is not as simple as using "sprayer" as a godrays2 mesh.  (4th arg in line 406).  I only did that... to make sure godrays2 was working.  Godrays2 really needs to be applied to the particles themselves (their textures), and not the particle sprayer.  The VLS shaders are here.  Let's hope this can be done without needing to modify the shaders.

Any miracle workers listening?  I'll take any assistance I can get... and feel free to rip-out those mirrors.  They are just a waste of eyeball energy, here.  :)  Advice/ideas welcome.

Link to comment
Share on other sites

Thanks for info... Dk... but DARN!!!  Double darn!  :)

It worked back in the v1.18 days.  Changes happened, I guess.  (sniff)

"Goodbye, my old VLS-on-particles friend.  I worked to keep you alive, but we had to let you go."  (your feet stunk)   :D

Oooh, maybe engine.createEffectForParticles(stuff).  Yeah... maybe.  Custom shader.  VLS for particles... version 2... the legend lives. heh  Twinkle twinkle little star-ticle.  hmm.  There's gotta be a way.  A tiny little particle, a thousand miles from camera... suddenly gets hit with a powerful laser, and reflects volumetric light back into the camera SO bright... that the camera "washes-out" for a microsecond.  Yeah!  YUM!  Mega-sparkle!

VLS on particles didn't QUITE do that (back when I saw them work)... but sort of.  I think we can do better... with particleEffects.  That... is a 'barely explored" part of Babylonia.  :)  And what a great project for playing with fragment shaders... and learning.  Yum.

Ok, back to the round-edge button-labeling challenge.  Yay!  Party!!!

Got rectangle2D (blue) shrunken enough, and placed near mesh-center, but button text is already down to 2pt font (line 173) and it needs to go smaller.  More likely, button itself needs be bigger.  MUCH bigger.  Coming soon.  :)

Link to comment
Share on other sites

@Wingnut

We need a new shader editor, and you have to code it.

This is just a scetch also for me, if i have time.

@Pryme8

Flip the Playbutton horizontally with Selection, senseless waste of energy after very little change i made i have to move diagonal all the way up.
I think the one who previously coded it, also never use it. Also i just select a preset once, i press the play button 100times.  
 
Flip the hole thing vertical. (Make the Bar a little smaller)

Make a single Big Editor Screen with tabs to switch between the shader modes.

So i have down at the bottom the play bottom, and then two tabs to switch. 

flip.gif

Link to comment
Share on other sites

Me?  :)  I would get a brain tumor. 

But it would be good if we had a choice in CYOS... for using particles and only a fragment shader (similar to that particleEffects demo, which was kindly coded by Deltakosh).

Hey @Nabroski... I'll code-up the new shader editor... if you reduce prices for all life-necessities... by 75%, world-wide.  Deal?  Cool.  :D

Link to comment
Share on other sites

New button!

http://www.babylonjs-playground.com/#14VFYX#15

I recently found Nockawa's post, introducing us to " Signed Distance Field" for Text2D rendering.  (thx to Davrous, too)

So, I decided to try it.  Line 41, I disabled the fontSuperSample.  Line 42, I enabled fontSignedDistanceField.  (fss is just a mis-named variable, currently set true)

Boy, Noxxy wasn't lying when he said it would render the text with more clarity.  Excellent improvement!  Well done, guys!

Me?  I need to make a "class" for this button, so I can generate lots of them... easily.  Sort of like putting the superello mesh generator... INSIDE of the bgen button generator.  But it needs to be done in a nice clean class.  The roundEdgeFatMeshCanvas2dRidiculousButton-class.  :) 

I need this class... to be similar-to our particleSystem.  It can construct a button with only 2-3 params in its constructor.  But after constructing, there's about 2000 properties to adjust, as wanted (just like particleSystem).  Cool knobs to turn.  :)  Updates "live".  :o  Observed.

ParticleSystem has a "particle" class.  I wonder if I need a "buttonMesh" class... used in somewhat the same way.  Hmm. 

Me not good OOP guy... me slow (and me ugly, too). :)

In the post before that... Temechon and Nockawa talked about the new "Canvas2D Inspector panel"... and that looked very cool, too.  I wonder if we can make it be a choice/tab... on our browser F12 dev tools menu.  Wouldn't that be sweet?  Anytime you browse a scene with some Canvas2D in-use, that extra tab automatically activates in dev tools.  YUM!  (dream)

Link to comment
Share on other sites

I will pull the CYOS today, and make some changes here over time... Yeah some reordering of the UI is definitely going to happen, a custom texture input field, a plane shape, global projection scene, a drop down with common variables, and a few quick timing functions... ohh yeah and a safe mode lock.

this is  what we were talking about right? I hope my quick glace at the topic does not have me off point.

Link to comment
Share on other sites

Hi gang.  Just a quick reminder to USA voters:  Feel free to do a write-in vote for me... Larry John Wendlandt... for USA president... if everybody else on the ballot sucks more than I do.  :D  My platform is... abolish money and ownership (but still have custodianships), add very strict fairness laws, absolutely free life necessities, all luxuries shared equally by all, and legalized recreational pot.  (yay!)

Oh yeah... this thread is for ANY topic, have fun.  Yes, there are two topics happening at the same time, right now.  Shaders (for intelligent people), and my stupid button (GUI for dummies).  :)

My stupid button got a face lift, yesterday.  I stole a "class" from a  @Temechon game (formerly a Ship class)... and used it as a template for my button class.  It starts at line 232 in the newest playground version.

Needless to say, it still has some "ship" properties and methods on it... but I will slowly convert them to Button properties and methods. 

Hey... Wingnut is using a "class" in his code!  How unusual is THAT?  AND... it works!   Well shut my mouth wide open!  heh.  I love it.  Thanks for the template, Temechon.  Fun ahead. 

I'm torn between using a heavily-loaded options object as a constructor parameter, or using a simple constructor with low parameters, and then having the programmer set lots of properties AFTER the creation.

And, I'm not sure how to do "live updating".  Is that an observer thing?  For example, if I want to change the font on a label... long-after it has been created... do I always need a setFont() method?  Or, can I change .currentFont ... and then an observer will "engage" it?  I'm SUCH a bad coder!  erf.  thx for advice. 

Vote for Wingnut!  If I win, I will hand-over national control guidance to a VERY smart think-tank (after enacting strict fairness laws and outlawing monetary discrimination).  We're going "commune" - love everyone and everything, and adopt everyone and everything.  Also, "asked" to work, never forced to work.  All should be fine.  (yikes).  byeeee!  :)

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