Making trees

Sage
Posts: 1,199
Joined: 2004.10
Post: #46
funkboy Wrote:It's great to see new screens of your engine. Very inspiring.

One thought about all games with water: where the water meets the ground. Is there anything you can do about that? Either by making the ground automatically take on texture modifications that make the ground "damp" (maybe just reducing the brightness of the textures that were just uncovered recently from the water), or even possibly make a little crashing against the wall?

The waves that appear when you intersect water with the object is similar to waves crashing against the land, I think.

Both of these matters are already being taken into consideration. I do darken the terrain under water -- I could just bump it up a bit. Waves against water edges, however, would be more complex. I do want to do it, however. It's really just a matter of defining edge patches and doing multipass with a frothy texture.

Right now, I'm takling bugs. The water doesn't render right with single-pass lighting... beats me why. I'll have some time spent in GL Profiler I suspect.
Quote this message in a reply
Member
Posts: 89
Joined: 2005.06
Post: #47
How long have you been working on this? What is your educational background?

Well since everyone else is doing it:
Twilight Coders
CIMyAdmin
Whatever
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #48
Volte Wrote:How long have you been working on this? What is your educational background?

I've been working on *this* in particular since August... regarding my education, I'm 100% self taught, except for some Pascal and C classes in high school. I was an art major, and studied painting and printmaking -- I do graphic design as my day job.
Quote this message in a reply
Member
Posts: 89
Joined: 2005.06
Post: #49
You


Are


My


Hero.


Seriously. You inspire me so freaking much. Where do you work? How did you land the job?

Well since everyone else is doing it:
Twilight Coders
CIMyAdmin
Whatever
Quote this message in a reply
Member
Posts: 47
Joined: 2004.07
Post: #50
For foamy stuff at the surf, take a look at GooBall - I used a fairly decent technique there where I multitexture 3 copies of a foam texture & use the texture matrix to scale & offset.

For the blending stuff, do you use Register Combiners? They are a bitch to code, but run at full speed on old Geforces. You can do many effects using these (if you can be bothered, that is). Hint: A lot of the examples that come in the Cg manual show how to use them properly

Nicholas Francis
http://www.otee.dk
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #51
Nicholas,

I've never heard of Register Combiners until now. It looks like something I ought to learn, however. Does it work on ATi cards?

That said, I made some minor improvements and bug fixes. But the biggest improvement was simply to make a better texture for the water. Instead of the classic caustics texture, I whipped up a perturbation texture in PS using the "ocean ripples" effect, and made a detail texture out of it. I render the texture twice using add-signed blending, on units 0 and 1 with different scaling and offsets across time, and a subtle spheremap on texture 2. Looks quite a bit better in my opinion.

[Image: Screenshots-2005-12-12-01.png]

[Image: Screenshots-2005-12-12-08.png]


Anyway, I'm reading the treatise on Register Combiners right now ( http://oss.sgi.com/projects/ogl-sample/r...biners.txt )...

Speaking of Gooball -- that game has the *best* shader performance I've ever seen on my 5200. Is Cg just that fast? I mean, I wrote a basically on-liner grayscale shader a while back and it knocked my framerate from ~100 to ~10 on my card...
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #52
As soon as I saw that you posted in the main forum page, I knew I was going to be shown up Smile. That really looks cool. It's inspired me to take back up that old 3d terrain engine I was working on a while back and keep working the engine into, hopefully, something like you have (though it'll take me tons longer because I don't know half the stuff you do). Good job. Looks great. Grin
Quote this message in a reply
Member
Posts: 47
Joined: 2004.07
Post: #53
GooBall mainly used normal Texture combiners on the GF5200 (+ a few Reg. combiners) Better cards get an ARB_FP version of most shaders. Then there were some some ATI_TEXT_FRAGMENT_SHADERS for the R8500-R9200 users.

The fragment programs it used were generated by Cg, then hand-optimised in assembly. Note: you can also use Cg to generate register combiners. And, like ARB_FP, you should hand-optimize those.

We used a version of nvParse to get the register combiner things going. Getting it to run on a mac was a bit of a bitch, but only took a day or 2.

I would like to warn you against using spheremaps. Not sure about later cards, but I've seen quite a few drop polycount _heavily_ when using it. We have a builtin option for unity to generate a cubemap out of a spheremap. Then we apply the cubemap if the card supports it.

But yeah - really nice looking water there. Good hack.

Nicholas Francis
http://www.otee.dk
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #54
NicholasFrancis Wrote:GooBall mainly used normal Texture combiners on the GF5200 (+ a few Reg. combiners) Better cards get an ARB_FP version of most shaders. Then there were some some ATI_TEXT_FRAGMENT_SHADERS for the R8500-R9200 users.

The fragment programs it used were generated by Cg, then hand-optimised in assembly. Note: you can also use Cg to generate register combiners. And, like ARB_FP, you should hand-optimize those.

We used a version of nvParse to get the register combiner things going. Getting it to run on a mac was a bit of a bitch, but only took a day or 2.

I would like to warn you against using spheremaps. Not sure about later cards, but I've seen quite a few drop polycount _heavily_ when using it. We have a builtin option for unity to generate a cubemap out of a spheremap. Then we apply the cubemap if the card supports it.

But yeah - really nice looking water there. Good hack.

This sounds a little out of my league -- but I'll look into it anyway.

Regarding spheremaps -- well, that's interesting and good news, since I'm planning on migrating to cubemaps anyway.

Thanks for the kind words,
Quote this message in a reply
Member
Posts: 47
Joined: 2004.07
Post: #55
Ok, from the top then (it really is not that bad)

1) Do normal combiners. We have a scripting language to set them up, but you don't need that.
2) If you want to use stuff like ARB_VERTEX/FRAGEMENT_PROGRAM, try writing it in Cg & telling it to generate the assembly stuff for you. (just use the cgc command line tool). I prefer working with the c-style shaders. When I find an effect I like, I then go in and hand-optimise that (if the object will be visible a lot). One of the nice things about C-style stuff is reusability. E.g. I'm using the same sine & cosine functions for making wavy trees in Intifada that were developed for gooball water.

3) If you want to get all the Radeon9200 (mac mini) guys up to speed, you should code it in ATI_TEXT_FRAGMENT_PROGRAM (or SHADER, can't remember). It's not that bad, but you need a machine to test it on.
4) If you want high performance from low-end geforces, you can do Register combiners - they are a major pain in the butt, and normally, I just can't be bothered.

---
This is my priority list for doing stuff. From least resistance to highest. There are a few tricks to get cgc to be nice, which I can go into if you care.

One way of doing these is to have effects; If you have an object that wants "SpecularLighting", you can try to see if you have a "SpecularLighting.arbfp" file & use that, or fall back to another level (or you select another shader). This is really nice, and scales quite well.

(Then there's the whole GLSL debate, which I don't really care to get into)

Nicholas Francis
http://www.otee.dk
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #56
You know, reading over this material, I feel like it would be better just to use Unity Wink

My problem here is that I love the actual programming too much. My interests lay in the engine details, like the scenegraph, physics, etc. I wish I could just slap on pretty graphics on top. For example, I had *way* too much fun writing the tree generation algorithms, and the water subdivision for scenegraph management. Making the water and tree geometry was way more fun than writing the gl code to make it render.
Quote this message in a reply
Member
Posts: 196
Joined: 2003.10
Post: #57
No no no! This engine looks terrific! You have such... graphic flair! Just post screenshots every week and we'll keep you going on compliments. Smile
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #58
TomorrowPlusX Wrote:You know, reading over this material, I feel like it would be better just to use Unity Wink

My problem here is that I love the actual programming too much. My interests lay in the engine details, like the scenegraph, physics, etc. I wish I could just slap on pretty graphics on top. For example, I had *way* too much fun writing the tree generation algorithms, and the water subdivision for scenegraph management. Making the water and tree geometry was way more fun than writing the gl code to make it render.
Perhaps there is cheap/free rendering library you could encorporate into your engine that could handle all the pretty graphics so you could do the other stuff that you love. I really want to see how far you take this engine because it's already impressive and just keeps getting better. If I see anything that might help you, I'll let you know. Smile
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #59
I've looked around and the most promising is Ogre3D, but it's a PITA to get to build right on OS X -- well, not the framework, but the demo apps barely work.

Plus, all the nice stuff Ogre gives you is too much for my wee 5200. Demos which run at 90fps on machines with good video cards render poorly and at 10fps on my powerbook.

Anyway, I consider myself "done" with the water system now. I've cleaned the code up, split it into a 3 pass render so I have better control over cubemap reflections and so on, plus I put in support for froth at the water boundaries. Finally, I added support for the water to be "frozen", where it becomes a solid geometry with collision and low friction. Aside from some minor tweaks I'm moving on...

EDIT New pics -- you can see a bit of a crappy "froth" texture at the edges, and the better mixing of cubemap reflection & the lerping to horizon-color based on the view angle -- and the final shot is underwater. I haven't ported my particle system code from my old engine so there's no bubbles or anything yet. There will be Wink

[Image: Screenshots-2005-12-16-08.png]

[Image: Screenshots-2005-12-16-09.png]

[Image: Screenshots-2005-12-16-14.png]
Quote this message in a reply
Member
Posts: 47
Joined: 2004.07
Post: #60
That looks nice. I'm really impressed with how waterlike you can make the waves look by doing a signed add of two ocean ripple textures. Could I get you to share some insights on how you perturb the texture coords? I would like to include something like it in Unity as a low-end water shader

Nicholas Francis
http://www.otee.dk
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  3d trees for game spinner 5 7,085 Oct 25, 2006 06:34 AM
Last Post: spinner