Jump to content

Incremental / progressive render


CarlBateman
 Share

Recommended Posts

Thanks but that doesn't seem to work. I'm building the scene in code, NOT loading it from file (sorry, if I didn't make that clear).

 

I'd like something like the pseudo code below:

makeFloor();makeSnowman();render.scene();for(i = 0; i < 100; i++) {  makeChrismasTree();  render.scene();}
Link to comment
Share on other sites

Hi Carl, welcome to the forum, and may I say, what a nice scene!  I'm Wingnut, hi, and I like to get involved where I don't belong... like getting into other people's business, and yapping when I'm not qualified to do so.  This is no exception.  :)

http://playground.babylonjs.com/#UT7U2

I used poor coding to cause the ground, lights, camera, and SOME of the snowman... to render right away.  Then a bit later, using more bad code in the scene.executeWhenReady function, the new buildLandscape() function executes. 

This solution is far from perfect, and I screwed-up all your indenting, but now we have SOMETHING for the user to look-at while your cool pine trees render.

I had to remove your big particles texture and use something smaller, because the playground refused to save the demo scene.  It thought maybe it was too large.  Once I did the change, it saved fine.

Anyway, this is a solution, but not a very good one.  Maybe some smarter people than I... will play with the scene, and get some better results.  I hope I didn't interrupt the flow of your thread.  I am not a very good coder, so there is likely better ways to do this.  :)

Do you realize that you look like American music legend Steve Miller?  :)  Again, welcome, and good luck.  Experts, help us out with this.  Carl wants the scene to assemble right in front of the viewer's eyes, I suspect.

Update:  I now notice that the playground demo doesn't progressively-render... THE FIRST TIME, but only when hitting the RUN button again, and again.  Shoot.  Maybe this is no solve at all.  Darn.

Link to comment
Share on other sites

Hi Wingnut,

thanks for the input, I considered your approach, but was checking to see whether there was a quick fix.

 

I'll probably progressively add items to the scene from within the render loop, when I get a chance.

 

Wow! That picture of me does look a lot like Steve Miller. Although he's slightly older than me. ;)

Link to comment
Share on other sites

I changed the code to add a tree once each time through the render loop. It works but is is a bit unresponsive until all the trees are added.

 

Next, I'm thinking of trying web workers, cloning or instancing.

 

Thanks for the suggestions, I'll look into them when I get chance... sadly my family demand my attention over Christmas... how inconsiderate ;) .

Link to comment
Share on other sites

How hard would it be to copy a loaded model from one canvas to another... say through an iframe?

 

What if you used an iframe to basically load the model in the background without disturbing your current game loop? Once it's ready to render on the iframe, you just push all the models details back to parent since the iframe already downloaded the model to your index etc.

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