Help - Search - Members - Calendar
Full Version: 3d Lake Example
Game Maker Community > Working with Game Maker > 3D Game Techniques > 3D Editable Examples
rivosaar
brac37 added terran reflection too. thanks to him.
look to second page!


GM6.gif Download (1.00MB) (no terrain reflection)
Phantom107
Great job.

I must say, this is a really good system to use the depth problems to create a nice effect. Although I think the 'distort layers' could use some work, it does look good and is a super efficient way to simulate a water effect. (Although the coding in your draw event can use optimization)

Tepi
Pretty good. Better than the one before, I think.

It's somewhere in the middle, not too near and not too far where the water looks the most realistic. It replicates the light scattering very realistically, and that gives the illusion of waving water. I like this, goos job. happy.gif

Now the only problem is the aliasing far away and the lach of realism when viewed closely, but I guess those will always be the cons of this method.
rivosaar
thank you!
yep, only small water is most best looking.
Schyler
QUOTE (rivosaar @ Aug 21 2009, 10:42 PM) *
thank you!
yep, only small water is most best looking.

How might you be requesting credit? Is this method uncredited, do you wish that we include you? This information would be helpful for alot of people, including myself, as I may feature a similar system in Liquid Light if I can get my new ideas to work the way I think they will.

Regards,
-Schyler-
rivosaar
dunno.
just use it smile.gif
or maybe you but my name somewhere
Schyler
I replaced the top section of the draw event with this, and it seems to look more like real water although slightly decreases the framerate.
CODE
d3d_set_projection_ext(x,y,z+20,x+cos(degtorad(direction)),y-sin(degtorad(direction)),-sin(degtorad(yles))+z+20,0,0,1,60,1.3333,2,10000)

d3d_draw_ellipsoid(x+5000+nihe,y+5000+nihe,5000,x-5000+nihe,y-5000+nihe,-5000,background_get_texture(tex_taevas2),1,1,24)

draw_set_blend_mode(bm_add)
draw_set_alpha(0.01)
d3d_draw_floor(0,1500,k6rgus,1500,0,k6rgus,sprite_get_texture(tex_vesi,ani),20,20);
draw_set_alpha(1)

draw_set_blend_mode(bm_dest_color)
d3d_draw_ellipsoid(x+4000+nihe,y+4000+nihe,4000,x-4000+nihe,y-4000+nihe,-4000,background_get_texture(tex_taevas),1,1,24)

draw_set_blend_mode(bm_normal)
draw_set_alpha(0.01)
d3d_draw_floor(0,1500,k6rgus,1500,0,k6rgus,-1,1,1);
draw_set_alpha(1)

I've basically just added a blend mode.

Regards,
-Schyler-
rivosaar
looks little better but its slower
slayer 64
wow, this is great.
[borat]
izz nicee
[/borat]
this is goin' in the Archives.
Glen
And then there's always the eye-candy that can be added to a scene like this.... That is, if you don't mind an FPS drop. Normally it's not advised to do this, but, here it is. Bloom and motion blur:

Click for Screenshot



Might not be the bloom people are looking for, but combined with the nice water effect you have, this scene becomes very eye catching. I enjoyed messing around with your lake example. Nice reflections.
gandalf20000
It's cool to see people attempting (and pulling off fairly nicely) complicated effects in GM-D3D. I use the Ultimate 3D DLL, so I get shaders, but I must say, you pulled this off fairly nicely. If you make it partially transparent and refract the land below it, it will look even nicer.
Pie Person!
Why can't we just use real reflections? They're more possible and frame-rate reasonable than you think.
Phantom107
QUOTE (Pie Person! @ Sep 16 2009, 02:13 AM) *
Why can't we just use real reflections? They're more possible and frame-rate reasonable than you think.

Then perhaps you would like to show us? I don't think it's possible to do fast without U3D.
Pie Person!
QUOTE
Then perhaps you would like to show us?

I'm saving it for the big firework.
Note: how can you assume that it is not possible (at a reasonable frame-rate) if you haven't tried. I am serious. Do you even know how it works?
brett14
QUOTE (Pie Person! @ Sep 16 2009, 03:26 PM) *
QUOTE
Then perhaps you would like to show us?

I'm saving it for the big firework.
Note: how can you assume that it is not possible (at a reasonable frame-rate) if you haven't tried. I am serious. Do you even know how it works?


An acheiveable method in GM (slow yes, but it works), and a "real looking" method is to draw the whole world flipped upside down in the water/surface (Or only the parts you can see in the reflection)
Phantom107
QUOTE (Pie Person! @ Sep 16 2009, 11:26 PM) *
Note: how can you assume that it is not possible (at a reasonable frame-rate) if you haven't tried.

Really now? Meaning I don't release most of my stuff doesn't mean I haven't tried. I tried and it's hopeless.

QUOTE (Pie Person! @ Sep 16 2009, 11:26 PM) *
I am serious. Do you even know how it works?

Oh, I am serious aswell. It is a waste of time.

- Distortion using surfaces is not going to work. You can't use surfaces in 3d properly.
- Distorting a surface is costly on itself.
- The flipping method is not going to happen. You're drawing everything twice -- too costly.
- Using the flipping method you can't do any distorting.

Conclusion: Failure.

Ok now, let's say you DO get it to work. Would it be worth it? No. It will be very performance hungry,
and will not look as good as doing it with Ultimate3d, which will even take LESS power to do so.


Whirligig
It's amazing sometimes what you can do with the alpha bug. Think of what would happen if GM8 used a version of DirectX that didn't have the bug.

I made a cool portal effect with this. I'll post it if you want it.
THE_GAME_EDITOR
QUOTE (Whirligig @ Sep 23 2009, 01:33 AM) *
It's amazing sometimes what you can do with the alpha bug. Think of what would happen if GM8 used a version of DirectX that didn't have the bug.

I made a cool portal effect with this. I'll post it if you want it.

Please, post.
I'd like to see that.
Linda_ml
Could you send us more detailed description of your needs? Then we can prepare example for you.

Regards,
Anh
filulilus
Damn that's so damn smart tongue.gif Great job! biggrin.gif
brac37
I have added terrain reflection. Notice that under water terrain gets above water to disturb the view when reflected. So you must chop off the under water part of the terrain for the reflection, which is not easy.



Here is a bandwidth sucking image.

general sirhc
Beautiful, although the ripples do look a little weird. Maybe making the ripples bigger would look nicer
Robert Colton
Wow at first I did not understand what you were trying to accomplish with this. Not even after your post in my topic. But this is a very neat trick! It would be better if you would turn off culling on the water...
d3d_set_culling(kameera.z > water_level); and make the water its own object and set its depth too change whether the camera is above or below it. It would allow you to see the the terrain under the water and water under the terrain.
B Factory LLC
Add a screenshot, please.
brac37
QUOTE (B Factory LLC @ Jan 1 2010, 11:24 PM) *
Add a screenshot, please.


Done.
krele
QUOTE (brac37 @ Jan 11 2010, 01:12 AM) *
QUOTE (B Factory LLC @ Jan 1 2010, 11:24 PM) *
Add a screenshot, please.


Done.

Orly?...

Just kidding. Your screenie on the first page got pwnt...
brac37
QUOTE (krele @ Jan 11 2010, 01:53 AM) *
QUOTE (brac37 @ Jan 11 2010, 01:12 AM) *
QUOTE (B Factory LLC @ Jan 1 2010, 11:24 PM) *
Add a screenshot, please.


Done.

Orly?...

Just kidding. Your screenie on the first page got pwnt...


Not mine. I dropped in on the second page.
rivosaar
good job wink1.gif
Newly Discovered
the terrain reflection is very neat. I added a sphere into the game and draw it in the kaamera draw event...I tried setting it up the same way as you did the terrain but I couldn't quite get it.
I wanted to reflect the ball as well as it flies over the terrain.

anyway, great job on the trick, I hope to see a real reflection one of these days brac!
Phantom107
QUOTE (Newly Discovered @ Mar 18 2010, 09:34 PM) *
the terrain reflection is very neat. I added a sphere into the game and draw it in the kaamera draw event...I tried setting it up the same way as you did the terrain but I couldn't quite get it.
I wanted to reflect the ball as well as it flies over the terrain.

You see, this works by faking distortion using GM-D3D's alpha glitch. So you can't "reflect" anything other than the skysphere. If you want real reflection, use the surface fix for GM-D3D or use the shader power of your GPU by using a DLL.
Newly Discovered
yeah, I meant surface fix for an actual reflection. maybe I'll study up on view direction/reflection and take a stab at it.
brac37
QUOTE (Newly Discovered @ Mar 18 2010, 09:34 PM) *
the terrain reflection is very neat. I added a sphere into the game and draw it in the kaamera draw event...I tried setting it up the same way as you did the terrain but I couldn't quite get it.
I wanted to reflect the ball as well as it flies over the terrain.

anyway, great job on the trick, I hope to see a real reflection one of these days brac!


You can easily draw a sphere and its reflection, as I did now in the above link, but the distortion effect is not very great. The terrain does not reveal so clearly that its distortion is not so great. I tried to improve the distortion a bit with a shear transform.

I adapted the terrain reflection scripts as well. You can choose any plane of reflection now, not just z=0. Furthermore, I added some options to the scripts. I will document them another time.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.