Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Landscape swaying grass effect.

Author
Message
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jun 2003 04:32
Hi all,

Messing around with Kevils landscape code - and came up with a nice little swaying grass demo. Would work on any engine and does'nt need fancy hardware, but it is slow on my PC (18-26fps) on a 1.1 Athlon with a GF2.

Screenie:


Demo: 2mb
http://www.realgametools.net/forums/attachments/wavygrass.zip


Van-B
My cats breath smells of cat food.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 23rd Jun 2003 04:44
i can't control the camera!!!

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
kevil
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Netherlands
Posted: 23rd Jun 2003 13:42
I can hardly see it, but how did you do it???
I'd like to know.

Kevil

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jun 2003 13:49
I explained it over at RGT - I don't like the swaying grass as much, so I'll post another demo tonight without swaying, it looks much nicer when it's static.


Van-B

My cats breath smells of cat food.
Hell IVIonkey
21
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 23rd Jun 2003 14:01
Didn't see your explanation, but it looks like you have several copies of the hills, each at slightly different altitudes, each moving in a slightly different manner, the layers above the first being ghosted.

Am I close?

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jun 2003 14:12
Hehe, no

It's an extra camera rendering to an image that is pasted to the screen as sprites at varying positions and alpha settings. The sway effect is just a slight rotation on the sprites.

I only spent an hour on it.


Van-B

My cats breath smells of cat food.
Hell IVIonkey
21
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 23rd Jun 2003 14:19
Ahhh, good idea. Needs a lot of optimizations though, to be honest, but good for 1 hour. I got about 8 or less FPS, though it was running in a window:
800MHz, 256pc133 RAM, GeForce4 mx440. Yeah, this is my slow computer.
Maybe you could make the sprite patches of grass larger?

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jun 2003 14:42
Hmmm, there's no grass there though - it's just the screen copied over itself. The blades of grass are purely accidental, because the screen is being pasted in a line, the brighter areas of the texture cause weird lines - or grass. I was actually looking at what happens when you overlay a seperate camera view on the main view - like for night vision, because you can set a seperate camera to a different range. The idea was that you render the hidden camera when using night vision, then sprite it over the top of the screen with the green diffuse full up. Not really for anything in particular, just messing around.

It might be possible to recreate this quicker with memblocks, like render the image from the extra camera and pass an effect through it before pasting it onto the screen.


Van-B

My cats breath smells of cat food.
Hell IVIonkey
21
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 23rd Jun 2003 15:01
Ahh...

Might look good with some grass sprites though anyhow, thought I'm sure this wasn't your intention to do. A lot of games use grass plains actually in the 3d world, but here's another idea. Create a bitmap made by pasting a bunch of grass images, each resized based on its 3d position (which can be projected to 2d to find the distance from the camera - linear interpolation). Then, overlay the bitmap of resized sprites atop the 3d scene. Just a sleepy thought...

Andy Igoe
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 23rd Jun 2003 18:32
I think your despondancy with the effect is premature VanB. Pressumeably this is some kind of texture animation? Have you considered the effect on the landscape with multiple textures so that not everywhere is grass?

Deep rough grass in the windward edges, shallow patchy grass to the leeward side. The grass effect would look very good if it wasn't the only texture in play. Some roads, or a sandy bits. A few rocks etc.

Pneumatic Dryll
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jun 2003 18:48
The problem is DBpro's speed.

If we could change the properties for objects rendered in an extra camera - like maybe even render them pure black, so they could be masked, we could do a lot, along with a speed boost with extra camera's of course. The way it works, means that dark areas are sorta left alone, so a dark road would work, a silhouete would work too.

I'm not done with it yet - I plan to look into memblocks, see what other effects I can muster. I'm thinking that this effect should be possible with memblocks, and only 1 overlay sprite - which might give it a speed boost. The way I'm thinking is if it's checking every pixel, the colour can be used to guage the effect, like a pixel with a lot of green could be turned into a blade of grass, a pixel with a lot of blue could sparkle randomly to simulate water.

The thing is - it'd work in any engine, it does'nt rely on anything except some sprites and a camera. So I might develop it into something more useful if I have the time.


Van-B

My cats breath smells of cat food.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 23rd Jun 2003 19:31 Edited at: 23rd Jun 2003 19:32
i can't control the camera!!! :\

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jun 2003 21:32
That's weird, it just rotates the camera depending on the mouse position, maybe you need to alt+tab into it.

Other than that I've no idea whats wrong - sorry.


Van-B

My cats breath smells of cat food.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 25th Jun 2003 19:16
it moves way to much!

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
Hell IVIonkey
21
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 26th Jun 2003 03:02
Mattman, it's not a game. It's a gfx demo.

Hexagram
21
Years of Service
User Offline
Joined: 22nd Jun 2003
Location: United Kingdom
Posted: 26th Jun 2003 05:26
That screenshot looks awesome, but when i downloaded in it looked like green grass like sea. But then again my graphics card sucks.

Home is where the heart is, on the bus! (-gj Gillete Cavalcade of sports)
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 26th Jun 2003 05:43
i never said it was a game! Its just that i cant see the grass due to bad camera control

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Jun 2003 15:39
Hey Van, i have a feeling how you may have done this (probably similar to me DB Enhanced Motion Blur) but you know if you grabbed the screen rather from the pixel point command (with locked pixel buffers i hope) you just copied the backbuffer into a memblock that is constantly open and overlayed that way.

just an idea anyways

I pride myself that i don't kill...
well not without a good reason
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 26th Jun 2003 16:38
I was thinking that - just take the camera's render image and effect it before pasting it back onto the screen. I don't really have time to experiment with it just now, I'll probably pick it up in a few weeks or so and look at other tricks. It's just a shame that DBPro is so damn slow with additional cameras, and using the default camera for the effect makes it look crap.


Van-B

My cats breath smells of cat food.

Login to post a reply

Server time is: 2024-11-21 20:26:36
Your offset time is: 2024-11-21 20:26:36