Some screens

Some screens

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

Moderator: Moderators

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

Some screens

Post by Argh »

New uses of precipitation GLSL. Currently just WIP.

Better snow. Multiple snowflake types, better blending method for a bit more visual "fuzz"... and more-varied vectors:
Image

Rain that has wind directions (it doesn't currently obey the "real" wind vector or velocity, but I don't have time right now):
Image

Sandstorm (again, doesn't obey wind vectors yet, and you can't really see the motion in the screen, but it's quite striking):
Image
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Some screens

Post by thesleepless »

cool, but those snowflakes look way too big and distracting
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Some screens

Post by Argh »

It's not so bad, when they're falling past the POV really fast. You hardly see the close ones.

There really isn't any cure for that, anyhow, other than maybe forcing all nearby point objects to clear and making a bubble around the camera. Maybe I'll write that, dunno.

I need to write a shader to handle snow on top surfaces of things, for things that are supposed to be snow-covered. It's wasteful to do that kind of thing with endless variations of models, imo.
Last edited by Argh on 14 Jun 2009, 23:37, edited 1 time in total.
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Some screens

Post by thesleepless »

can you modify the different mip levels in a DDS? the nearest mip level could be blurry.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Some screens

Post by Jazcash »

Cool stuff. All the first picture needs now is loads of lights on the trees.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Some screens

Post by Beherith »

Really like sandstorm, is it a combo of precip and fog?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Some screens

Post by smoth »

so we are seeing?

I also thought spring did not really have a real wind direction.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Some screens

Post by lurker »

It has a full velocity; you can see some particles move in it.
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Re: Some screens

Post by MidKnight »

Does it work on ATi cards?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Some screens

Post by Argh »

1. It's all variations on the precipitation Widget, just minor changes to GLSL and a few things I thought up.

I haven't screwed around with this stuff for months, since I first cleaned up User's simple plane fog and wrote the first weather particle system besides Trepan's (which was simple and terribly CPU-eating). Thought I'd add these things as final touches on some new maps I'm doing, since it looks like this precipitation code works a bit better.

2. See Spring.GetWind. I just don't have time to turn that back into offsets xyz and figure out the scalar stuff right now, and then there's the fact that to do it right, you'd have to do a gusting algorithm, so that it didn't look really lame- IRL, you'd see some particles pick up the wind first, etc., and that's very messy unless particles are actually clouds of points, instead of individuals. That gets into a bunch of complex stuff that I don't want to touch atm, the last time I messed with it I wasn't ever happy with it.

3. I have no idea whether it works on ATi cards, but it's using the same GLSL base as the precipitation shader that Behirith used on that snowy map, which you reported was working for you.

4. I just wrote a cube around the POV that clears particles away, to prevent "over-large" particles. I may even extend that idea, it has other uses.

Oh, and I also fixed the code for the fog, so that it no longer overdraws UI elements, period.

I apologize for not having time to make a movie of these. It's kinda silly seeing them in stills, as they're basically all about building better dynamic motion, but I figured people could get the gist of it from my text.

The total effect is quite striking, though- the sand storm, for example, whooshes rapidly across the screen, the rain obeys the "wind" but different drops have slightly different vectors, the snow still uses sine-curve motions to drift, but is clearly also being carried by "wind", etc. It's all really simple stuff that makes this shader behave a lot more like what we see in the real world, basically.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Some screens

Post by CarRepairer »

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

Re: Some screens

Post by Argh »

They're point objects ;)

Here are a couple of shots, showing the effect of the cube fix in action:
Image
Image
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: Some screens

Post by 1v0ry_k1ng »

it dosnt look good in stills.. post a video clip of the three?
User avatar
smartie
NOTA Developer
Posts: 146
Joined: 23 Jun 2005, 19:29

Re: Some screens

Post by smartie »

That looks pretty nice. The snow looks like it might be distracting thou. I wonder if there's some way you could soften the effect

Post Videos! :-)
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Some screens

Post by thesleepless »

a bit of a blur on the snow textures should do it i think.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Some screens

Post by Argh »

Built a much better version of my lightning / thunder gadget, to go along with the GLSL rain.

Here's sourcecode. I figure that this is something people will want to use for various things- amongst other things, remove the graphical stuff, and voila, you have a simplistic ambient-sound generator.

This requires the LUPS Module or 100% compatible to use as written (i.e., it'll work CA for sure) but I'm sure it could use CEGs instead with very little effort.

Code: Select all

function gadget:GetInfo()
  return {
    name      = "Thunder Gadget",
    desc      = "Lightning and Thunder.  Requires LUPS Module or 100% compatible",
    author    = "Argh",
    date      = "June 22, 2009",
    license   = "GNU GPL, v2 or later",
    layer     = 0,
    enabled   = true  --  loaded by default?
  }
end

math_rand = math.random
local MaxSizeX = Game.mapSizeX
local MaxSizeZ = Game.mapSizeZ
local randomTime = 0
local randomFlashes = 0
local randomX, randomZ

if (gadgetHandler:IsSyncedCode()) then

function gadget:GameFrame(f)
	--Spring.Echo(f,randomTime)
	if f == randomTime then
		randomX = math_rand(0,MaxSizeX)
		randomZ = math_rand(0,MaxSizeZ)
		randomSound = math_rand(1,5)
		if randomSound == 1 then
			Spring.PlaySoundFile("sounds/thunder05.wav", 30, randomX, 1000, randomZ)
		end
		if randomSound == 2 then
			Spring.PlaySoundFile("sounds/thunder06.wav", 30, randomX, 1000, randomZ)
		end
		if randomSound == 3 then
			Spring.PlaySoundFile("sounds/thunder07.wav", 30, randomX, 1000, randomZ)
		end
		if randomSound == 4 then
			Spring.PlaySoundFile("sounds/thunder08.wav", 30, randomX, 1000, randomZ)
		end
		if randomSound == 5 then
			Spring.PlaySoundFile("sounds/thunder09.wav", 30, randomX, 1000, randomZ)
		end
	end

	if f >= randomTime and randomFlashes > 0 then
		SendToUnsynced("lups_lightning", randomX, randomZ)
		randomFlashes = randomFlashes - 1
		return
	end

	if f >= randomTime and randomFlashes <=0 then
		randomTime = f + math_rand(300,500)
		randomFlashes = math_rand(10,30)
		return 
	end
end

else

local mySize, myLife, randomT, randomA1, randomA2
local randomTexture = 'bitmaps/lightning1.tga'

local function SpawnLightning(_, randomX, randomZ)
	local Lups = GG['Lups']
	randomX = randomX + math_rand(-1024,1024)
	randomZ = randomZ + math_rand(-1024,1024)
	mySize = math_rand(512,1536)
	myLife = math_rand(10,30)
	
	randomA1 = math_rand(0.5,1.0)
	randomA2 = math_rand(0.3,1.0)

	randomT = math_rand(1,3)
	if randomT == 1 then
		randomTexture = 'bitmaps/lightning1.tga'
	end
	if randomT == 2 then
		randomTexture = 'bitmaps/lightning2.tga'
	end
	if randomT == 3 then
		randomTexture = 'bitmaps/lightning3.tga'
	end
    	
	Lups.AddParticles('GroundFlash',{
		texture = randomTexture,
		layer=-40,
		pos={randomX,Spring.GetGroundHeight(randomX,randomZ),randomZ},
		life = myLife,
		size = mySize,
		sizeGrowth = -12,
		colormap = {{0.9, 0.9, 1.0, randomA1},{0.5, 0.5, 1.0, 0.1},{0.9, 0.9, 1.0, randomA2},{0.5, 0.5, 1.0, 0},},
		repeatEffect=false,
	})
end

function gadget:Initialize()
	gadgetHandler:AddSyncAction("lups_lightning", SpawnLightning)
end

function gadget:Shutdown()
	gadgetHandler.RemoveSyncAction("lups_lightning")
end

end
Post Reply

Return to “Map Creation”