Cyber Vision

Cyber Vision

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

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Cyber Vision

Post by zwzsg »

Here is a widget that turn your graphics into how the digital world used to be portrayed.

Image

Image

Image
Attachments
CyberVision.lua
Put into \LuaUI\Widgets\
Warning: Some games require special procedure to load local widgets.

Fiddle with gl.PolygonOffset for messier lines / cleaner outlines.
(12.21 KiB) Downloaded 23 times
Last edited by zwzsg on 30 Oct 2013, 23:32, edited 1 time in total.
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: Cyber Vision

Post by FireStorm_ »

cool!
works fine as far as i can tell :-)
User avatar
Funkencool
Posts: 542
Joined: 02 Dec 2011, 22:31

Re: Cyber Vision

Post by Funkencool »

Looks awesome :-) Just out curiosity, why not use the engine mesh for the terrain?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Cyber Vision

Post by zwzsg »

Funkencool wrote:Looks awesome :-) Just out curiosity, why not use the engine mesh for the terrain?
Sorry? I don't understand the question.

Initially the widget started when I made a Lua skybox, and realized it wasn't possible because it was either being clamped for being too far away, or would hide the engine-rendered terrain. Since I didn't want to throw away what I already had coded, I decided to disable engine ground rendering, and render it myself. Of course, since the terrain texture is not available to Lua (only the minimap texture is), I just dropped terrain texturing altogether. At that point, I had to render units in wireframe to stay consistent.
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: Cyber Vision

Post by dansan »

You made me smile a stupid, nostalgic smile, feeling thrown 20y back in time :-)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Cyber Vision

Post by smoth »

I cannot get the darn thing to show :(
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Cyber Vision

Post by Jools »

Wow, really nice. Reminds me of my first computer game.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Cyber Vision

Post by smoth »

for s3os it is kinda bad.
Image

because we have tris
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Cyber Vision

Post by Anarchid »

since the terrain texture is not available to Lua
... until 95.0, that is. And you could always do that trick that zk terraform uses - render diffuse to texture, then use said texture.
because we have tris
Needs some screen-space postprocess
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Cyber Vision

Post by knorke »

I like that half the widget is about creating the best random characters.
Looks nice! Like any nice looking things my computer does not like it: with the widget in widgets\ Spring hangs during "finalizing".
Strangely it also hangs when enabled = false
When the widget is copied into widgets\ after gamestart then spring will hang on /luaui reload
http://pastebin.com/p5mpNSXK
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Cyber Vision

Post by CarRepairer »

http://imgur.com/a/UGlLJ

Without widget my FPS is 120.

With widget if I'm looking at the scrolling characters, my FPS is 4.

If text is not in view, FPS is 50.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Cyber Vision

Post by zwzsg »

CarRepairer wrote:Without widget my FPS is 120.
With widget if I'm looking at the scrolling characters, my FPS is 4.
If text is not in view, FPS is 50.
Yes, I suppose drawing every unit and feature twice more, and in Lua, is not very good for performance.
That having text in view slows you down, however, is harder to explain.
smoth wrote:for s3os it is kinda bad.

because we have tris
Find attached updated in first post a new version, where high poly s3o looks good slightly better.

Image

By changing the gl.PolygonOffset at line 481 from -2,-1 to, let's say, 2,0, you can get even less lines drawn, for a cleaner outline.

Image
knorke wrote:I like that half the widget is about creating the best random characters.
:-)
knorke wrote:Spring hangs during "finalizing".
I sprinkled liberally the new version with ClearWatchDogTimer, hope that help.



Also new is that I now display metal spots by tinting the map green wireframe into red.
Last edited by zwzsg on 30 Oct 2013, 23:34, edited 1 time in total.
User avatar
Falcrum
Posts: 149
Joined: 14 Nov 2007, 01:03

Re: Cyber Vision

Post by Falcrum »

Great idea, but very tired my eyes, especially moving background :/
Last edited by Falcrum on 30 Oct 2013, 23:11, edited 2 times in total.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Cyber Vision

Post by CarRepairer »

You shouldn't attach updated versions to posts at the end of the thread. Please update the first post each time.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Cyber Vision

Post by zwzsg »

Ok, updated first post.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Cyber Vision

Post by CarRepairer »

Thanks. I love the widget. Except I suspect it's part of your diabolical plan to make all spring games and maps become like Kernel Panic. Very clever.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Cyber Vision

Post by knorke »

Commententing
--DrawPrism(PrismNumberOfSides,PrismHeight)
in DrawWorldPreUnit() made it not hang. Did not look/find what excactly.

The 3 visible sides of big cube are drawn in 3 different ways:
front: lines in two directions
top: lines in one direction
right side: just black

Image
(resize and jpg made it a bit less clear)

Sometimes (when faces are parallel to camera plane, i think) some lines get drawn that should not be visible:
Image

Both these effects together make the units seemingly change appearance/shape when moving camera around, a bit confusing.
Maybe messing with PolygonOffset can fix it?

Really neat effect.
To have it for all units and everything is maybe a bit overkill and techdemo-ish. If it was only for some units (like buildanimation or units that get "downloaded" via teleport) would be cool.
Post Reply

Return to “Lua Scripts”