Christmas in Spring - Page 3

Christmas in Spring

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

Implamented!!!

Yep, I have this in a map and working.

However... currently It can realy only do snow well, so it needs some modifying.

I know your probablie bust trapan (what with teh new release stuff) but I was wondering if you could make a change or to?

Most importantly... it settels on water currently and slowly fades... Is there a way to stop that? I assume its to do with this bit:

Code: Select all

        vec3 pos = scalePos - mod(camPos, scale);
        pos.y -= time * 0.5 * (speed * (2.0 + gl_Vertex.w));
        pos = mod(pos, scale) - (scale * 0.5) + camPos;
        if (pos.y < 0.0) {
          gl_FrontColor *= 1.0 + 2.0 * (pos.y / scale);
          pos.y = 0.0;
        }
        const vec4 eyePos = gl_ModelViewMatrix * vec4(pos, 1.0);
                
        gl_PointSize = (1 + gl_Vertex.w) * 5000 / length(eyePos);

        gl_Position = gl_ProjectionMatrix * eyePos;
However, I don't understand it completly, the the obvious things like pos.y < 0.0 ... I figure I could change that value so it settels somewere below the map, but thats just a messy work around.

The other thing, which would help it look way more like rain is that it would help if teh particles could be stretched out in the upwards direction. I'm not sure if thats as easy though as currently each drop is jus ta point, were to do taht it would need to be some sort of vertacie made of 2 points... with the image stretched between the two points but still always facing the cammera... so as if the view is from the top you would have an almost undeformed image (as teh points would apear close together) but from teh side it would be elongated upwards. Being able to set the lenght between the two points would alow for heavyer and lighter rain.

So its cool... but needs a few bits and bobs befor it looks REALY good.

Is any of that possible?

aGorm

:: EDIT :: Also... Is there a good place to learn Lua? A good site that helps you understand the basics? Only it doesn't look like it would be hard to write once you knew what it wanted.... just I have no idea what it wants yet.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

aGorm wrote: :: EDIT :: Also... Is there a good place to learn Lua? A good site that helps you understand the basics? Only it doesn't look like it would be hard to write once you knew what it wanted.... just I have no idea what it wants yet.
Seconded. I have four widgets outlined which I want to work on and have no idea where to start.
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

YHe... mines even simpler... I just want to flash teh screen semi white for a split second and play a thunder noise after a random interval... (nott hat that would definaly be in teh map as it might be to distracting... but it would be cool to show off the map in videos and stuff)

aGorm
Post Reply

Return to “Lua Scripts”