Shaders’ Outpost
Moderators: winston, another_commander
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
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":-
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.
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.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
For animated lights, I think the approach used in Freaky Thargoids is probably better.
E-mail: [email protected]
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- 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:
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
If anyone has a grasshopper stripper animation lying around…Arexack_Heretic wrote:one step closer to animated grasshopper-stripper neon signs.
E-mail: [email protected]
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
Are they the same ones that work in some of the more 'entertaining' Hoopy Casinos?Arexack_Heretic wrote:grasshopper-stripper
"Get back or I unleash my lethal spotted batoid!!"
What I do when not reading the Oolite bulletin board!
What I do when not reading the Oolite bulletin board!
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- 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:
Why yes, they could very well be.
They have suchtasty shapely legs....
'Ants in the pants' is another insectoid trans-species erotic act.
edit: Sssss!
They have such
'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!
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Not quite as racy as a stripping grasshopper, i do have a drinking astronaut:-Ahruman wrote:If anyone has a grasshopper stripper animation lying around…
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:-
'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?
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- 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:
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
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.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?
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
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.
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.
E-mail: [email protected]
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
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.
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.
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- 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:
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.)
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!
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
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.
E-mail: [email protected]
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- 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:
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.
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.
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.
I have been surfing through wiki, wikipedia and openGL tutorials, but I'm not finding much sense out of it all.
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.
Last edited by Arexack_Heretic on Tue Oct 09, 2007 7:55 pm, edited 1 time in total.
Riding the Rocket!