Shaders’ Outpost

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2476
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

i've found a glsl tutorial ( http://www.evl.uic.edu/arao/cs594/final/) which uses a "discard" function in a fragment shader which seems to work like a 3d program "clipmap":-
Image
thats just a polygon box floating in space but the shader isn't rendering anything that's below a certain colour intensity threshold in this case
"cutting" around the letters so you can see the planet between the letters.
i reckon using this on some double sided polygons would make a great (although wafer thin) neon sign.
I've uploaded it here, http://www.box.net/shared/ja5374870y although it's in a pretty useless state at the moment - it's using the crappy scrolling uv method i used in my billboard shader to illuminate the B A R sign letters which looks really awful, what it needs is something like in ahrumans shader where it transisions from one frame to the next, i've had a go at copying his code into the shader with some odd results and as soon as i can get it working properly i'll post it up here. although this version could be used to provide lights running along landing strips, docking bay walls etc.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

For animated lights, I think the approach used in Freaky Thargoids is probably better.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1878
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

Woot! :D

one step closer to animated grasshopper-stripper neon signs.
:lol:
Riding the Rocket!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Arexack_Heretic wrote:
one step closer to animated grasshopper-stripper neon signs.
If anyone has a grasshopper stripper animation lying around…
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

Arexack_Heretic wrote:
grasshopper-stripper
Are they the same ones that work in some of the more 'entertaining' Hoopy Casinos? :wink:
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1878
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

Why yes, they could very well be.
They have such tasty shapely legs....

'Ants in the pants' is another insectoid trans-species erotic act.

edit: Sssss!
Last edited by Arexack_Heretic on Thu Sep 13, 2007 5:42 pm, edited 1 time in total.
Riding the Rocket!
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2476
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Ahruman wrote:
If anyone has a grasshopper stripper animation lying around…
Not quite as racy as a stripping grasshopper, i do have a drinking astronaut:-
Image
aargh, the animated gif-ification has knackerd the colour pallete a bit.

Cmdr. Maegil usually mentions some rough sounding spacebar he's been hanging out in in his welcoming posts to new board members and it sounded so cool i thought i'd try and make one:-
Image
'The Wormhole'
(the little rock floating beside the main rock is going to be the smoking area :) )

Um, you don't happen to have a suitable animated neon shader hanging around on your hard disk at all do you Ahruman?
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1878
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

superb as ever Griff.

You have a way of 'getting right' the things I have been trying to model and texture for...years now actually. :oops:
I especially adore the nice portio-docking ledge.

ps Is that neon sign for real or just a animated gif?
Riding the Rocket!
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Wow!!!!!

I love it!!!!

I'm almost speechless!!!!
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Griff wrote:
Um, you don't happen to have a suitable animated neon shader hanging around on your hard disk at all do you Ahruman?
The not-quite-ready updated Shady Billboard shaders would probably make a good start, after tearing most of it out. :-) I’ll try to knock something up (oo-er) in the coming week.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

A simple animation.

This is subject to known limitations: no alpha blending, and no additive blending. It just uses reject to cut out bits with <0.5 alpha.

There’s also no way to stop the sign from showing up when shaders aren’t available, so you’ll need an appropriate static sign texture for that case.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2476
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Ahruman, thanks for taking the time to write the animated shader, it's going to be perfect, really excited that you've even included the "cut around the letters" effect! great stuff!
I'm hoping to put a load small non-animated neon signs fixed around the model so it looks like a little community of seedy establishments but the poly count is already in the thousands so i'm not sure.

cheers A_H & TGHC, the animated sign i posted above is just a few simple shapes drawn in photoshop onto seperate layers and then just moved about into different poses and saved out as individual frames for the animation - i tried to do one of a space rocket circling an oolite hyperspace wormhole but i just couldn't get it looking anywhere near half decent so i recycled the rocket into my avatar instead!

The "neon outline" effect i got from a tutorial i found on the web which annoyingly i've lost the link for now, i'll try and find it and post it here as it's a neat little tutorial, it's basically using the 'glowing outlines' and 'stroke' layer effects, the cool bit is the fact that you put a colour gradient going from dark to light to dark again into the stroke effect and you get that great tube light effect.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1878
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

just made my first animated...thing.

Just by crudely replacing Ahruman's texture though. ;)

I'll try to do something similar but on a ship tomorrow.
Hopefull I can get the animation to work on a ship, without glowy-stuff.
Gotta get some shuteye first.


Q:
So...would it be possible to use these shaders to apply decals?

(I saw group-number could be bound, If this could be used to alter vertexlocations for a single animation... Or better yet, use the entity ID.
Or does the coordinate of the effect correspond with the base texture? In which case You'd have to add a shader-tex for each number.)
Riding the Rocket!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

You can calculate different texture co-ordinates for each texture used in a shader, or use different parts of the same texture. So yes, shaders could be used for decals.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1878
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

How do you calculate these coordinates actually?

I have been surfing through wiki, wikipedia and openGL tutorials, but I'm not finding much sense out of it all. :oops:

DLing rendermonkey, maybe that will do it for me. :)


I guess decals would only be practical for vehicles that all use the same texture/model and are expected to have decals? Racers, police etc.

As each different model would need to have a different decal-shader...in order to apply the effect on the right place on the model... ?

Just coming to grips with the texcoord calculus now.
I can see how you could use the method you used in the animation-example to apply a given frame on a model.

Not sure how exactly tex1 is mapped on tex0 (which is AFAIK the model-base-texture.) I'll figure it out...someday.

Code: Select all

   // Load texture data
   vec2 texCoord = gl_TexCoord[0].st;
   vec4 colorMap = texture2D(tex0, texCoord);
   vec4 glowMapFullOn = texture2D(tex1, texCoord);
   vec4 effectsMap = texture2D(tex2, texCoord);

gl_TexCoord[0] is the coords for texture 0. (I assume it creates a 2D matrix from the dimensions of the texture's pixels?)
so these lines define that the other textures use the coord-system of tex0.
Fine as long as the textures are of the same proportions. (else you need to offset the coord system as examplified in the animation-example)
em. rambling along...nothing to see here. :roll:
Last edited by Arexack_Heretic on Tue Oct 09, 2007 7:55 pm, edited 1 time in total.
Riding the Rocket!
Post Reply