Page 4 of 32

Posted: Sun Sep 09, 2007 8:48 pm
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.

Posted: Mon Sep 10, 2007 7:34 pm
by JensAyton
For animated lights, I think the approach used in Freaky Thargoids is probably better.

Posted: Tue Sep 11, 2007 3:24 pm
by Arexack_Heretic
Woot! :D

one step closer to animated grasshopper-stripper neon signs.
:lol:

Posted: Tue Sep 11, 2007 3:47 pm
by JensAyton
Arexack_Heretic wrote:
one step closer to animated grasshopper-stripper neon signs.
If anyone has a grasshopper stripper animation lying around…

Posted: Tue Sep 11, 2007 4:19 pm
by Uncle Reno
Arexack_Heretic wrote:
grasshopper-stripper
Are they the same ones that work in some of the more 'entertaining' Hoopy Casinos? :wink:

Posted: Wed Sep 12, 2007 1:00 pm
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!

Posted: Sun Oct 07, 2007 7:48 pm
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?

Posted: Sun Oct 07, 2007 9:03 pm
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?

Posted: Sun Oct 07, 2007 10:46 pm
by TGHC
Wow!!!!!

I love it!!!!

I'm almost speechless!!!!

Posted: Sun Oct 07, 2007 10:59 pm
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.

Posted: Mon Oct 08, 2007 1:45 pm
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.

Posted: Mon Oct 08, 2007 7:00 pm
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.

Posted: Mon Oct 08, 2007 11:06 pm
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.)

Posted: Tue Oct 09, 2007 11:51 am
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.

Posted: Tue Oct 09, 2007 5:56 pm
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: