Dark Bit Factory & Gravity

GENERAL => Challenges & Competitions => Topic started by: Motorherp on July 01, 2008

Title: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 01, 2008
Hiya folks.  This is my first entry to a comp here, I hope you like it.  Unfortunately we've gone into crunch mode at work again, the final push for the last deadline.  So for the next 6 to 10 weeks I'm going to be an overworked caffeine fueled pizza eating zombie with no social life and no time for other projects.  Therefore I might as well post what I have now since I'm not going to be able to do anything more with it before the deadline.

This is a windows xp program written in C++ using DirectX which proceduraly generates bonzi tree meshes.  It's only in wireframe at the moment since I wanted to concentrate on the mesh generation algorithms.  There's a few things missing I wanted to add such as roots and leaves etc, it could use more optimisation, and there's still some problems with it, but all in all I'm quite pleased with the result.  Press space to generate a new tree and escape to exit the program.  Some results are more aesthetically pleasing that others, the generation algorithms could use a bit more tweaking, so you might want to hit space a few times.  And please be patient, it can take a while to load.  Enjoy.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Shockwave on July 01, 2008
Oh noes! I can't run it and it looks interesting too!
Quote
Application failed to start because the application configuration is incorrect.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Clyde on July 01, 2008
Thats what I get too.
Looks amazing in the screenshot, cant wait to try it.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 01, 2008
Hmm it could be the code generation setting I used to build it.  Could you try this one and let me know if it works.

Edit:  I replaced the file in the original post with the new one and removed this extra one rather than uploading two programs.  Try that if you could.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: hellfire on July 01, 2008
"enIsoSurface failed to lock mesh vertex buffer"
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 01, 2008
Now that's strange.  That means you got passed the DX mesh creation ok which implies you can run DX stuff.  I cant see why it would fail to lock the vertex buffer for you though if it gets that far, I dont really see how that can be dependant upon someone's machine.  Then again I'm no DX expert.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: rain_storm on July 01, 2008
Well it runs here anyway :)

Looks cool seein the spinning tree, Loading does take a while but not too long. Nice one Motorherp its a shame you dont have the time to finish it
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 01, 2008
Well I'm glad it works for someone  ;D.  Anyway Hellfire, I've changed the mesh to be dynamic which might fix the issue for you.  I've also changed the error reporting code so it should hopefully now spit out a DX error code if anyone gets any problems with DX stuff like that.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Shockwave on July 01, 2008
Ah it works now, takes a while to initialise but it's well worth it :)
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: hellfire on July 01, 2008
now it works and looks cool!
(geforce 7600 btw)
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 01, 2008
Sweet, glad it's working for you all.  Yeah it needs some serious optimising.  There's some tricks I could do such as partitioning the space to cull chunks away from the iso surface generator for example.  I'd definately have to spend some time on that if I wanted to include something like this in a full demo.  A nice thing though is that the generation runs in a seperate thread so I could hide the load times with other less intensive stuff in the demo such as the greets.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Clyde on July 01, 2008
Says I need d3dx9_36.dll
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 01, 2008
Says I need d3dx9_36.dll

Try installing the latest version of DirectX 9, hopefully that will help.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Clyde on July 01, 2008
Cheers
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Clyde on July 01, 2008
Thats really awesome, welldone dude  8)

Cheers and all the very best,
Clyde.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Rbz on July 02, 2008
Works fine here, nice generated model, just need some foliage :)
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: combatking0 on July 02, 2008
Groovy - it sort of looks like a wire-frame effect.

This one would also look good in a Halloween competition.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: benny! on July 02, 2008
After loading screen, screen remains black :-(

However, screeny looks very promising !
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: hellfire on July 02, 2008
It behaves a bit strangely on my dual-core at work.
Most of the time it just hangs after "loading", sometimes it crashes, sometimes it works.
Probably some threading-issue?
It would also be great if you could use a bigger rendertarget when resizing the window.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Pixel_Outlaw on July 02, 2008
The Marching Cubes came through quite nicely!

The loading time is understandable considering the complexity of the shape you are creating from scratch.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 02, 2008
It behaves a bit strangely on my dual-core at work.
Most of the time it just hangs after "loading", sometimes it crashes, sometimes it works.
Probably some threading-issue?

Very possible.  The program multithreads and I wasn't able to test it on a multi-core machine.  My machine at work is quad core so I could possibly try to fix it, but I dont think I'll find the time :(.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Voltage on July 03, 2008
This unfortunately doesn't work for me on the work PC.

I get a "loading..." message for about 15 seconds (flashing), then a black screen. 

The screen shot looks interesting.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 03, 2008
Out of interest benny and voltage, what are your computer specs.  That might give me a hint to what's going on.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Voltage on July 04, 2008
Intel P4 3.00Ghz - Using Nvidia 7300GS - 1 Gigola of RAM

Edit: Windows XP SP2
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: benny! on July 04, 2008
I tried it on some GeForce at my working place running Win XP.
I can tell you the exact gfx card model next week.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Praecor on July 06, 2008
After upgrading dx it worked!

Cool.

It's not easy to gen natural trees like that from scratch. awesome job.

I can't wait to see some leafs on and generated wood+texturemapped version.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Motorherp on July 06, 2008
Thanks for the comments.  Indeed it took a lot of tweaking and iterations to get them to start looking natural.  What I finally settled on for the demo was to layer several iso splines ontop of each other for each branch and slightly perturb the node positions using a gaussian distribution.  This gave the branches a more natural shape rather than looking like pipes.  I also used combinations of gaussian distributions and white noise the generate the positioning and curvature of the branches and used repulsion forces to seperate the branches out.  It took a lot of tweaking but I think it was worth it  ;D.
Title: Re: [PLANTLIFE] Pseudorandom Zen
Post by: Optimus on July 09, 2008
Cool 3d tree mesh