Lua Skybox
Moderator: Moderators
Lua Skybox
Hi dear Lua Coders!
I highly dislike asking for favors, but could someone, who is better at lua and openGL than me, please make a widget that draws a skycube around the map? I would like to rotate it via lua to make it look like map is in orbit.
I would be very grateful, and help your project in return with whatever you need and I can provide.
Thanks!
I highly dislike asking for favors, but could someone, who is better at lua and openGL than me, please make a widget that draws a skycube around the map? I would like to rotate it via lua to make it look like map is in orbit.
I would be very grateful, and help your project in return with whatever you need and I can provide.
Thanks!
Re: Lua Skybox
Can I have the texture? Or at least, know how you'd unwrap the cube?
Re: Lua Skybox
The problem is that the current interface can't handle Cubemaps - except the engine ones and those only via shaders.
Re: Lua Skybox
Well, I was thinking all I need is 6 drawn quads, I can set the textures for them manually. Dont know if 6 textures are better than 1 in this case.
Unwrap could be standard cross? But this wastes half the tex space, so maybe a compressed run of 2x3 squares? But thats not pow2 size...
Thanks zw:
Skybox:
http://beherith.eat-peet.net/stuff/Eta_ ... eherith.7z
jK, How much of a performance hit would it really be if i had lua just draw 6 quads way outside before drawworld?
Unwrap could be standard cross? But this wastes half the tex space, so maybe a compressed run of 2x3 squares? But thats not pow2 size...
Thanks zw:
Skybox:
http://beherith.eat-peet.net/stuff/Eta_ ... eherith.7z
jK, How much of a performance hit would it really be if i had lua just draw 6 quads way outside before drawworld?
Re: Lua Skybox
Behe you are the meanest battering ram evar approaching the gates of featurecastle. We are going to have tumbling meteroids - Hurray
Re: Lua Skybox
The advantages of Cubemaps are:Beherith wrote:jK, How much of a performance hit would it really be if i had lua just draw 6 quads way outside before drawworld?
* you need to bind just 1 texture instead of 6
* you just need to render 1 fullscreen-quad instead of a cube
PS: a 24MB uncompressed dds is everything else than fast to render
Re: Lua Skybox
I am familiar with the advantages of a cubemap, jK.
Though you yourself just pointed out that the bindings for such are unavailable at the moment. So the question was, is it gonna be that big of a performance hit on modern gpus to manually render the cube for a cubemap?
Though you yourself just pointed out that the bindings for such are unavailable at the moment. So the question was, is it gonna be that big of a performance hit on modern gpus to manually render the cube for a cubemap?
Re: Lua Skybox
I tested it as a \LuaRules\Gadgets\ but I assume it would work as well in LuaGaia. Read it for details about the texture.Beherith wrote:please make a widget
In :nc: the :n: means nearest and the :c: clamped. You will probably want :l: (linear interpolation) instead of :n:
Since polygons are one-sided, I would have expected half my faces to be inverted, but somehow it's not the case. If it happened to be the case, then iterate through the vertice of each face the other way by exchanging some pair of lines positions in the script.
I am not sure about my TexCoord, feel free to edit their values if you find oddities in the UV-mapping.
Oh by the way, for the bottom face I recommend replacing the 1/3 by 0.33, so you have at least one pixel margin on the two edges of the bottom face that touch west and south faces. All the others /3 can stay /3 as anyway every other edge is either actually shared, touching border (and thanks to the :c: won't interpolate to the opposing border), or touching an unused UV space.
My local d= is too low. I'm pretty sure that you could see a face of the cube cutting a corner of the map if you look at it from the opposite corner while the cube is sideway. So replace 1.2 with 1.5. Also, instead of recalculating d every frame, you could make it a constant. Anything bigger than the map diagonal + camera height, but lower than whatever values makes OpenGL coordinates overflow.
- Attachments
-
- GreatCubeInTheSky.lua
- (2.83 KiB) Downloaded 142 times
Re: Lua Skybox
Thank you very much, its all I ever dreamed it to be :D
What can I do for you?
What can I do for you?
Re: Lua Skybox
I want to just save that voucher for a Beherith hand for later. I'm sure I could use it, but I wouldn't want to waste such an offer only to find it spent when I'll really need it.Beherith wrote:What can I do for you?
- Attachments
-
- GreatCubeInTheSky.lua
- V2
- Corrected comments about faces.
- Made it spin in a dizzier way.
- Texture not mirrored anymore.
- Bug: When interpolating on the picture border, Spring fades to transparent. - (2.72 KiB) Downloaded 135 times
Re: Lua Skybox
Heheh, I'd love to see a Beherith-designed KP map, personally - not that I'm in the position to ask.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Lua Skybox
Does this mean we can finally draw a giant f--- in sky?
Oh man I just couldn't help myself. <3 emmanuel
Oh man I just couldn't help myself. <3 emmanuel
Re: Lua Skybox
yeah and we can animate said f*** in sky
Re: Lua Skybox
Thanks, looks pretty freakin sweet ingame :D
-
- Posts: 1398
- Joined: 17 Sep 2008, 04:36
Re: Lua Skybox
I sense epicness incomingBeherith wrote:I would like to rotate it via lua to make it look like map is in orbit.
Re: Lua Skybox
did you stop working on the ice map behe ? :D