Jump to content

The Wingnut Chronicles


Wingnut
 Share

Recommended Posts

No video there, in FF21.  (Same as long ago when I tried it).  In IE11 I saw a few frames, and then the browser locked up.  Tried it again in IE11, same result...  'babylon.js is not responding' after a few frames of video.

 

In FF21, I also still see 'ecranning' (white squares) coming from the bathroom and kitchen sinks/basins... just like long ago.

 

In Omega Crusher... still see lots of white squares... in FF21 and IE11.

 

In FF21, I have security.fileuri.strict_origin_policy = false.  I set it to true, no change, then set it to false again, no change.

 

http://urbanproductions.com/wingy/babylon/misc/flat_ff21.jpg

 - no video on tv, and squares rising in bathroom

 

http://urbanproductions.com/wingy/babylon/misc/omega_crusher_ff21.jpg

- many white squares (ecraning) :)

 

http://urbanproductions.com/wingy/babylon/misc/omega_crusher_ie11.jpg

- more ecraning

 

If you and others don't see these problems, then I must have something broken locally that I need to fix. Likely no problems with BJS.  Maybe my computer is too weak.  Dell Inspirion 537 - Intel Celeron 2.2 ghz - 4GB Ram - Win 7 - on-motherboard video (no video card). 

 

I wonder why DOM video element works fine, but not video texture.  *scratch scratch*  :/  Thanks for reply and thinkings.  I will keep testing.  http://stemkoski.github.io/Three.js/Video.html works for me... but that is enemy lands and I don't feel safe around there.  hehe.  Plus the video is scary.  haha.

 

Maybe stupid question but...  PAL/NTSC concern?  Or maybe http://stackoverflow.com/questions/13572304/video-texture-in-webgl-not-working (power of 2 stuff)?  That user had sound but no picture, like me.  *shrug*

Link to comment
Share on other sites

Hi DK, thx for reply.  According to Dell, I have the newest drivers.

 

http://stemkoski.github.io/Three.js/Video.html works.  Would that work if I had old drivers?

 

Would you please download and unzip http://urbanproductions.com/wingy/babylon/videotexture/vmirror01.zip to your local drive and take a look at my code?  I think I might be making a code mistake.  I do that often. :)  ( 5 megs )

 

The video html5 element in the upper left corner... plays the video good for me.  But no video on the plane.

If vmirror01.htm works on your computer... (video on the plane)... I will be seriously puzzled.  (Nothing new for me)

 

Included is sintel.ogv, the video used in the stemkoski demo.  It seems to me that if the stemkoski URL works (and it does), then I could not have a driver problem. 

 

But there is much I don't know... as you well know.  :)  THANKS!!!  Where is your donations cup?  I'm really rich!  (yeeeeeah right) :)

Link to comment
Share on other sites

Hi temechon, thanks for testing!  No change.  No video on box top or sides or bottom.  Still good audio.  I also toggled firefox->tools->options->advanced->use hardware acceleration when available... no difference.  I keep that OFF normally, to fix some corners on HTML borders that I had problems-with.  I set it to OFF again.

 

Your findings are interesting, though, eh?  *scratch scratch*  Maybe I set some knob on my computer incorrectly... or something.  Quite the brain teaser.  :)  Thanks again for the tests.  Please post any other/new findings if you (or anyone) discover some.  THANKS!

 

Alteredqualia's fancy demo also works for me...

http://alteredqualia.com/three/examples/webgl_materials_video.html

 

PS:  IE11 hates nearly everything. :)  In IE11, when testing mp4, ogv, flv, 3gp, webm, only the mp4 worked in the HTML5 video element, and the webGL failed to render, even with mp4.  Console says security error in BJS line 1.  I DID see the webGL once, right after setting IE11 security level to lowest and doing a reload.  No video on box.  But even though the webGL refused to render, I hear the audio from the mp4.... coming from the webGL scene.  WEIRD! SO WEIRD!  :)

Link to comment
Share on other sites

Here what I have on a google chrome last version : http://i.imgur.com/FKiWR1r.png

 

Not tested with Firefox though, but I did have this problem (no video displayed) with another video on Chrome, and it was due to the video codec issue.

Give me two hours and I will test it with FF/IE.

 

See you later !

 

Edit : And it works with a box instead of a plane and FF last version 27.0.1. IE 11 does not works because of the video used, but everything is ok with "small.mp4".

Link to comment
Share on other sites

Thanks for the info, T.  Good job!  The only reason I have not updated from FF21 to something newer... is because new FF is trying to shove 'tabbed browsing' up my ass (pardon my Klingon dialect).  I was hoping they let me turn off the tabbed browsing bar in future firefox.  There have been many people angry over forcing users to have a tab toolbar.  I decided to stay with FF21 for that reason.

 

I am quite a video nut, and have BSPlayer Pro 2.50, and Media Player Classic, and I have installed a large portion of the KLite Codec Pack.  But I don't know if any of this is pertinent... when the Stemkoski demo works.  Its webGL and video.  That tells me that there is a difference in the framework itself, and that if certain adjustments can be made to BJS framework, it will play the same video texture on this computer (and on a plane).  I am not saying that it is plausible to do that adjustment to BJS, though, but I would still love to discover the difference of BabyonJS and ThreeJS that causes this... just for curiosity's sake.

 

In my IE11, the Stemkoski demo fails with a black plane and no audio... and the alteredqualia demo fails to render the webGL, but I hear good audio.

 

Codecs are SUCH a fought-over situation, and these problems are certainly understood and expected due to that.  It is interesting.  Thanks again for the legwork and information, Temechon... and anyone else who is testing and experimenting.  I sure wish I were much smarter about these things.  Then maybe I could be more useful.

 

EDIT:  Temechon:  I think DK's following question is for you... but no rush.  :)

Link to comment
Share on other sites

Hi gang!

 

I am looking at user question... http://www.html5gamedevs.com/topic/4507-basic-postprocess/?p=27796

 

Maybe this user is having problem with local loading of shaders/blahblah.fx  (because of XHR security) ?

 

I know this problem well. XHR security limits is a HUGE hassle for me.

 

SO...  I was wondering... could we do...  babylon.allShaders.js ?

 

I recently tried to run a scene (the videoTexture scene talked about in the last few posts) ... using separate BJS framework loading.  (NOT using a compacted BJS but instead loading all the separate files.)  Lets call this separate loading... 'discrete loading'.  Discrete = individually separate and distinct.

 

When using local discrete loading, I can easily 'play' with babylon.videoTexture.js ... and 'mess with things' to try to get video textures working for myself.  Using the compacted/compressed babylon.js... experimenting/playing is much more difficult.  Actually, near impossible.

 

I built a 'starter'.htm file with 62 script elements that did the discrete loading.  Everything worked fine... EXCEPT... getting XHR to load shaders/blahblah.fx files.  That stopped me dead in the water.

 

IF... we had 'babylon.allShaders.js' ... that put all shader codes into an array/json obj, and IF the BJS-core shader-loading functions... checked-for the existence of that array... I think we could eliminate these problems with loading .fx files from local drives.

 

As best I can tell, only two BJS core files... load .fx files.  babylon.effect.js and babylon.fxaaPostProcess.js

 

COULD shader code be stored in a JS array instead-of .fx files?  IF SO, would this be the last road block for allowing us experimenters to discrete-load the BJS framework?  (load as seperate files - locally)

 

Thoughts, anyone?  Thanks!

Link to comment
Share on other sites

RE: .fx loading... perhaps. hehe. 

 

I used "local" three times in my post, and "locally" once.  :)  DK, are you living in Washington state these days?  Be real careful with that marijuana they have over there...  its some real mind-numbing stuff.  hehe.

 

I'm just having some fun with you.  :)  Please don't be offended. 

 

YES, locally.  i don't have a web server.  :)  95% of all computer users in the USA.... don't have web servers.  This is also why many of us find no use in .babylon files... and prefer sceneloading something that works locally... like .js or maybe .xml...  or maybe .dae.  ANYTHING that gets us past the annoying XHR security hassle.  Thanks.

Link to comment
Share on other sites

@Temechon: COuld you try with a Ground with 1 subdivision?

@ Wingnut: Actually this is possible.

By default Babylon.js look for shader there:

BABYLON.Effect.ShadersStore[vertex + "VertexShader"]

BABYLON.Effect.ShadersStore[vertex + "PixelShader"]

 

So if you extract the shaders from the .fx files and put them directly into the SHadersStore it will work.

Link to comment
Share on other sites

@Deltakosh : It works with a ground with 1 or several subdivisions, but still not working with a plane (only sound, no image)

 

Edit : Fun fact : if the plane is rotated to be like a ground, it works ! 

 

@Wingnut : could you try to add this line please ? 

tv.rotation.x = Math.PI/2;
Link to comment
Share on other sites

Ok, some progress!  YAY!

 

First... I had this...

 

            tv.material.diffuseColor = new BABYLON.Vector3(1, 1, 1);
            tv.material.specularColor = new BABYLON.Vector3(1, 1, 1);
            tv.material.backFaceCulling = false;
            tv.material.diffuseTexture = new BABYLON.VideoTexture("vid", ["./textures/sintel.ogv"], 512, scene, false);
 

Well, Wingnut, don't do that!  :)  Line 1 and 2 should be Color3, not Vector3!  DUH!  Wingnut being an idiot.  :) Oddly, though, after correcting to Color3... the box still seems to be black by default, and not white.

 

[much text removed here - see next post]

Link to comment
Share on other sites

Yes, yes, yes, DK.  Further experiments... lights ARE an issue here.  Move the PointLight around a bit, and the video shows on the other sides of the box.  DK, you are amazing.  Thank you!!!  You are a GOD!  Temechon, thank you, too!  Excellent testing!

 

var light2 = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene);
   light2.diffuse = new BABYLON.Color3(1, 1, 1);
   light2.specular = new BABYLON.Color3(1, 1, 1);
   light2.intensity = 1.5;

 

Video comes alive on all sides of the box!  AMAZING!  Still dark on box bottom but that is correct per light placement.

 

Video works on the plane, too.  Still upside down with text reversed on front face... but that is just a little material mapping thing.

 

I am brain-programmed to assume video provides its own light... like a tv does.  heh.  But no, Wingnut!  diffuseTexture is a standardMaterial, and needs to be lit.  sigh!  It is going to take me 1000 years to be as webGL-smart as DK.

 

Sorry for the unnecessary work, gang.  Poor testing by Mister Wingnut.  Sigh.  I am an idiot.  (Wingy shakes his head at himself).

 

The original quest was to test reflection of video in a mirror texture... and here is a working zipped demo...

http://urbanproductions.com/wingy/babylon/videotexture/vmirror04.zip

 

Lots of fun parameters to monkey-with in videoTextures... such as the parameters inside the BABYLON.Plane() function... and the reflection level. Mad scientist area!  :)

 

ASIDE:  Did anyone ever notice... that in https://github.com/BabylonJS/Babylon.js/wiki/04-Materials ... there is no mention of diffuseColor, specularColor, or emissiveColor ?  That should probably be 'adjusted'.  :)  They are rather important parameters for standardMaterial.  PARTY ON!

Link to comment
Share on other sites

Thanks, DK, but in my opinion, we need to do it better.  This would be the FIRST use of Color3 in the whole tutorial series.  Maybe the new user has never seen/used a Color3.  I would suggest giving them/us examples...

 

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

The diffuse is the native color of the object when it is lighted. You can specify a solid color with diffuseColor property:

 

materialSphere1.diffuseColor = new BABYLON.Color3(1.0, 0.2, 0.7);

 

Or, you can use a texture:

 

materialSphere1.diffuseTexture = new BABYLON.Texture("grass.png", scene);

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

 

And do that for specular, ambient, and emissive.  IMHO.  :)  Maybe even provide a link to the 'All about Color3' sub-tutorial. 

 

Okay, maybe not THAT far... but... we are talking to new users here.  The better the tutorials, the less basic questions get asked in the forum.

 

AND... if you really want to get fancy... later, in the lights tutorial... you could put a warning...

 

CAREFUL:  Do not accidentally use .diffuseColor and .specularColor for lights.  Those are used in standardMaterial only.  Make sure you use .diffuse and .specular.

 

OR... you could change the name of those two light parameters...  to make them match materials.  Why not make the lights be diffuseColor and specularColor... the same as materials?  You already use hemisphericlight.groundColor.  Inconsistencies like these... might generate annoying forum questions.  *shrug*  I hope I am not being a jerk.

 

Can I continue?  :)

 

particleSystem is a weird name.  Why not particleSprayer or particleEmitter?  *shrug* Not important. :)

 

And, remember how I grabbed my own copy of particleSystem, and turned off the vertexBuffers so I could make it spray other primitives like planes, boxes, spheres, cylinders, cones, etc?  Well, I had a crapload of fun doing that... and sometimes I think particleSystem could allow that by default.  Or maybe one kind of sprayer is called particleSprayer, and another called meshSprayer?   *shrug*

 

The current particleSystem only allows rotating around the z axis.  In other words, it is spraying sprites (quads that always face the user).  If the particleSystem were allowed to spray boxes (for example), we would want random all-axis rotation (tumble).  Same with tetrahedra (3-sided pyramids) and 'quadrihedra?' (4-sided pyramids) which could be added as new BJS primitives.  We would want them to have an all-axis-tumble option too. 

 

Constantly updating a random tumble... is likely real hard work. MAYBE the only way to do that... is with cannon.js.  SetPhysicsState on the meshParticle, applyImpulse at some random angle and contact point, then clearPhysicsState, then launch the meshParticle.  Maybe impossible.  Maybe a dream.  :)

 

Triangles (another new primitive) and quads (sprites) could remain as they are... always facing the user.  But they could ALSO do full tumble as an option.  Planes (a different kind of quad) would all-axis tumble by default... just like the other sprayed advanced primitives.

 

So, IF we do not split particleSystem into particleSprayer and meshSprayer...  then the NEW (overloaded) particleSystem would allow spraying triangles, sprites (no-tumble quads), planes (quads that tumble), boxes, cylinders, spheres, torus, and the new 'tetrahedra' and the new 'quadrihedra' primitives.  :)

 

Too much too fast, huh?  Thoughts?  "Yeah, sounds good, Wingnut.  Get to programming it!"  hehe.  Ouch. 

Link to comment
Share on other sites

Thanks DK, but that is not going to happen.  Those are YOUR documents.  My version of the tutorial is at http://urbanproductions.com/wingy/babylon/tutorial/master.htm which contains my disclaimer and probably a pile of mistakes made by me.  You see how easily I make mistakes.  This thread is chocked full of me making mistakes.  :)

 

No, you are the owner and controller of the official tutorials.  My 'experience' tells me that I am too inexperienced to be editing the official tutorials... and there is no place for me to write "This edit was made by someone who is often an idiot". 

 

Use my suggestion, or not.  I think its a wise one... but you must weigh its wisdom, and determine if its wise for the public.

 

Sorry if that is a disappointment.  I hope you still like me okay.  (I will pay you to still like me okay.)  ;)

 

Section 4 of MY tutorial is updated (neener neener).  What is taking you so long with yours?  hehe.  And who knows the minimum and maximum range of specularPower?  I just stole an example from octree.js that sets it to 32.  I wonder what a setting of 99999 would do.  Or how about material.specularPower = "medium"?  :) Or maybe... material.specularPower = new BABYLON.Engine(canvas, true);?  Browser = CRASH!  hehe. 

 

Ahhh, datatypes... ya gotta love 'em.  But maybe most important, ya gotta TEACH 'em.  ie. Color3.  Does .diffuseColor = RGB(255, 45, 18); work?  Does .diffuseColor = #ff2c1f; work?  Does .diffuseColor = "cornflowerblue"; work?  How would a user know?  The docs eventually need to include information about allowed datatypes and allowed ranges, right?

Link to comment
Share on other sites

Okay, okay, I registered on github.  But I am seriously scared, and you are seriously insane, DK.  :)  How can you trust the maintaining of a fine porcelain shop... to a garbage truck driver?  I don't know about this.  My gonads are SO FAR sucked-up... that I can feel them in the back of my throat!  :)

 

I put tutorial 4 in the editor.  NO CANCEL BUTTON!  Only preview and save.  Oh my God.  I used the BACK button... back, back, back, back to my bowl of soup, crackers, and an episode of Gilligan's Island.  Ahhh.  Safe.  hehe.  Phew.

 

I will pursue further, after I read more about that system.  I promise.  :o

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