New Snow Gadget v0.6

New Snow Gadget v0.6

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

New Snow Gadget v0.6

Post by Argh »

New snow gadget; like the rain, it uses a cut-down P.O.P.S. variant, and is a lot faster than previous code.

Needs the bitmaps- put into bitmaps/snow.

See release below; short of bugs, this is the final release, with a balance between aspects of performance, compatibility and speed.
Attachments
Snow.zip
(17.44 KiB) Downloaded 27 times
Last edited by Argh on 01 Feb 2010, 22:53, edited 4 times in total.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New Snow Gadget

Post by Beherith »

Code: Select all

[      0] Display List Built!
[      0] POPS Successfully Compiled
And I still see nothing :(
Btw, old snow was practically free for me anyway.

Edit: same with new rain.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget

Post by Argh »

Well, that's annoying. I'll check the shader log.

OK, the shader log is now totally empty over here... if it doesn't do anything, please find the line where it says "Snow shader log".
Attachments
POPS_SNOW.lua
(14.94 KiB) Downloaded 14 times
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New Snow Gadget v0.2

Post by Beherith »

Code: Select all

[      0] Display List Built!
[      0] Snow Shader Log Reports:
[      0] POPS Successfully Compiled
still nothing
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget v0.2

Post by Argh »

Ok... did you put the file in LuaGaia/Gadgets...

And put the usual two files into LuaGaia/ ? ...see attached.
Attachments
main.lua
(98 Bytes) Downloaded 16 times
draw.lua
(53 Bytes) Downloaded 16 times
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget v0.2

Post by Argh »

Here's another potential fix. I found a layer conflict that can cause it not to operate properly (under unusual circumstances, mind you). It does cause the "running but no errors" behavior you described, though.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New Snow Gadget v0.4

Post by Beherith »

gagdet in luagaia/gadgets, added main and draw to luagaia, flakes in bitmaps, and still nothing

Code: Select all

[      0] Loading LuaGaia
[      0] gf1 = LuaGaia/Gadgets/pops_snow.lua
[      0] gf2 = LuaGaia/Gadgets/pops_snow.lua
[      0] Loaded gadget:  POPS SNOW           <pops_snow.lua>
[      0] gf1 = LuaGaia/Gadgets/pops_snow.lua
[      0] gf2 = LuaGaia/Gadgets/pops_snow.lua
[      0] Display List Built!
[      0] Snow Shader Log Reports:
[      0] POPS Successfully Compiled
[      0] Loaded gadget:  POPS SNOW           <pops_snow.lua>
[      0] Loading LuaUI
[      0] Using LUAUI_DIRNAME = LuaUI/
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget v0.4

Post by Argh »

Flakes in bitmaps/snow... but that should have caused errors.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New Snow Gadget v0.4

Post by Beherith »

Ok it works now.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New Snow Gadget v0.4

Post by Beherith »


Pops snow:

Pros:
  • fast (275 fps on my testmap)
    realistic snow movement
    nice varied snowflakes
Cons:
  • Wierd bout of snow at start
    snow is tied to camera, looks super fake when scrolling (rain is also tied to camera, but its much less noticeable.
trepans snow:
Pros:
  • fast (285 fps)
    snow is tied to map, so its much more realistic
cons:
  • snow particles sometimes float on water for a while before disappearing, i should fix that
    particles close to camera arent culled, can be annoying when zoomed out alot.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget v0.4

Post by Argh »

OK, here's another potential cause of problems- apparently, under some weird circumstances (I caught this running both snow and rain simultaneously) you can cause a matrix problem, which means the snow doesn't get translated correctly.

This fixes that problem (now I see rain, snow and regular P.O.P.S. stuff all behaving correctly at the same time).

As for pros / cons:

1. I didn't have the same performance you're reporting- this is faster on my hardware (I've finally ordered a new motherboard, but for now I'm still stuck on the old rig). This is due to the size of the display lists, basically. The tradeoffs are that it eats a teeny bit more CPU doing events.

2. Fixing the snow on water's easy enough- if gl_Position.y <= 1, just give it a new gl_Position way up in the sky.

3. Yeah, I tied it to the camera, because I wanted to keep performance up. I really don't think it's that bad if you aren't looking for it. The only really practical way to remove that is to go back to the Giant Display List of Dewm, which I'd really like to avoid.

4. Most importantly... even after I spent time debugging that version I posted awhile ago, trepan's shader still borks on a lot of hardware. Since P.O.P.S. has already been tested and found to be working on most hardware, and since people have said that they can't see the trepan snow, I thought I'd give it one more shot. I think stuff like snow is really cool and adds a lot of atmosphere.
Attachments
POPS_SNOW.lua
(15.19 KiB) Downloaded 12 times
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New Snow Gadget v0.5

Post by Beherith »

1. As usual, YMMV. I have an 8800gt, and 1 shader per map is practically free for me. Even two hardly hit performance. Mind you this gfx card and system is 3 years old now.
2. Cool, ill do that.
3. I see :(
4. Glad it works on most hardware, these effects are awesome.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: New Snow Gadget v0.4

Post by smoth »

Argh wrote:3. Yeah, I tied it to the camera, because I wanted to keep performance up. I really don't think it's that bad if you aren't looking for it. The only really practical way to remove that is to go back to the Giant Display List of Dewm, which I'd really like to avoid.
I noticed this with your earlier work on the rain effect as well.

It is really noticeable when the user scrolls to check his units. I would say that it is worth the effort to fix.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New Snow Gadget v0.5

Post by Beherith »

In my opinion it isnt really noticeable with rain, in fact I only noticed it after slowing down the rain a _lot_.
But with snow its hard not to notice.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: New Snow Gadget v0.5

Post by smoth »

I noticed it with the rain right away, but assumed arturri was using a very early version of this rain code. Cuting corners like this to get higher fps pretty much defeats the purpose of such an effect.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New Snow Gadget v0.5

Post by Beherith »

Another bug: seems like the shader is leaking somewhere, the number of snowflakes on screen gets smaller (down to 5 by 20 mins) and the fps drops.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget v0.5

Post by Argh »

Well, some good news- I think I've figured out a reasonable way to get it done.

More when I've had a little more time to polish it.

Oh, and you're quite right, the drift is causing a problem which I'll have to fix.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget v0.5

Post by Argh »

OK, here's a fix for the drift problem, and it's not tied to the camera's position.

It uses instancing to keep the number of particle updates really low. I'm going to try one more change, to see if it speeds it up any, but I doubt it. This is somewhere in between the performance I see with my modified version of trepan's code using point objects and the P.O.P.S. version- I don't really like it's performance, but it's probably going to run on ATi OK.
Attachments
POPS_SNOW2.lua
(15.4 KiB) Downloaded 15 times
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget v0.5

Post by Argh »

Version 0.6.

This is the final version; uses a selective instancing check to determine which systems to run, and is quite fast for overhead views (and reasonable for long views, although ymmv for long views on giant maps).
Attachments
POPS_SNOW3.lua
(15.91 KiB) Downloaded 18 times
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New Snow Gadget v0.6

Post by Argh »

Here's a screen with reflections turned on (see source for details, and be warned that it's expensive):

Image
Attachments
screen00003.jpg
(110.01 KiB) Downloaded 2 times
Post Reply

Return to “Map Creation”