Amazing vertex shader animated shark

Amazing vertex shader animated shark

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Amazing vertex shader animated shark

Post by jK »

they don't have to be synced, you can use lua animations and a vertex shader.

(I already animated a shark with this technique)

no download video - traffic limit reached
Last edited by jK on 22 Jan 2010, 00:56, edited 2 times in total.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Info about "rotating wheels"

Post by Argh »

Can we see that?
User avatar
daryl
Posts: 200
Joined: 08 Oct 2006, 10:33

Re: Info about "rotating wheels"

Post by daryl »

jK wrote:they don't have to be synced, you can use lua animations and a vertex shader.

(I already animated a shark with this technique)
i don't know this technique :( where can i read about it?? it is difficult? i know only COB script :cry: ( Becouse i was a OTA player )

ps: nice your shark!!!
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Re: Info about "rotating wheels"

Post by Masse »

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

Re: Info about "rotating wheels"

Post by Argh »

Ah, OK, so you're doing vertex displacement using a sine. Neat. How'd you weight the verts? A multitexture param?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Info about "rotating wheels"

Post by Tobi »

Exactly my (first) point :-P

Looks nice though.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Info about "rotating wheels"

Post by Beherith »

User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Re: Info about "rotating wheels"

Post by Caydr »

One of these days I'm going to learn what a shader is.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Info about "rotating wheels"

Post by AF »

Its a little piece of code that runs on the gpu that shades things
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Amazing vertex shader animated shark

Post by Beherith »

Can we please have the code for this? Pretty please?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Amazing vertex shader animated shark

Post by PicassoCT »

worshipped are the devs- this is amazing
User avatar
Spawn_Retard
Posts: 1248
Joined: 21 Dec 2006, 14:36

Re: Amazing vertex shader animated shark

Post by Spawn_Retard »

am i missing something, or is everyone having a huge erection over a shark?
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Amazing vertex shader animated shark

Post by SpliFF »

You're missing something.

The animation is done entirely on the GPU, that's pretty awesome.

Also, for bigger erection, it is run from Lua rather than relying on C++ gl directly, meaning it will work in Spring right now just by adding to a mod.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Amazing vertex shader animated shark

Post by PicassoCT »

he misses it completly, with that thing, you can make flaping birds, butterflys, nearly everything, just shoveling a little model and a view shaderslines into the graphic processor

damn i neeed a new keyboard this one is dead by droooling.
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Re: Amazing vertex shader animated shark

Post by MidKnight »

Yesss...
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Amazing vertex shader animated shark

Post by jK »

1. I would never start a thread with such a title
2. http://home.arcor.de/jkei/CustomUnitShaders.sdz

It's a whole easy configurable API (check LuaRules/Configs/customShaders.lua) for per-unitdef custom shaders and includes 2 examples: normalmapping for armpw&armwar and the vertex animation for the angelshark (do /cheat /give angelshark).

PS: And yeah this stuff is pretty old >1 year (normalmapping example was added 1-2months ago).
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Amazing vertex shader animated shark

Post by Beherith »

I apologize for the thread title, but I split it from a random other thread and had to give it a name.
Thank you very much for the shaders and the framework! You rock massively, ill get to work on my plans now :)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Amazing vertex shader animated shark

Post by Argh »

Took a look.

1. Wow, that's short.

2. Self-shadowing doesn't seem to be working in the normalmap shader. I've fixed it over here, I'll release source later.

Haven't tried plugging my variant of Kloot's shader into this yet.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Amazing vertex shader animated shark

Post by jK »

Argh wrote:2. Self-shadowing doesn't seem to be working in the normalmap shader. I've fixed it over here, I'll release source later.
Didn't said that the gadget is 100% finished.
Also noticed the "//#define use_shadow" in the shader?
It's just the gadget that doesn't handle shadow enable/disable atm.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Amazing vertex shader animated shark

Post by Argh »

Meh, just saying. I've also done some other minor changes.

Couple of other things:

1. If the shader crashes, it takes Spring down, no error messages. I was fooling around with stuff, trying to make it match the results I get with the one I'm using now, and found that out the hard way.

2. For stuff that uses three textures, obviously we need to define that somewhere much more handy than in the materialDefs.

I've been using customParams. I don't like the concept of putting that into the config unless it's just a loop that searches unitDefs- the normalmap's name should be in the UnitDef, like everything else that's unique about the Unit, imo. Sorry if that sounds anal or whatever, but it really helps with maintenance, if things like that aren't stored in a totally-different textfile somewhere else. Anyhow, just my opinion about that.

3. DDS normalmaps are getting flipped. What's up with that?
Post Reply

Return to “General Discussion”