Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Cryect

Iridescent Shader and Tutorial for Damage Blurring

Recommended Posts

Alright after finding out how stupid I can be sometimes (though did get useful info from Carmack) here is an iridescent shader (which basically changes color based on the angle you look at it). Later I will be making a demonstration of how to use it to make water look oily.

http://www.geocities.com/cryect/shaders.html






And here's a link to my tutorial on how to get the edges of the screen to blur while the center of the screen stays sharp as you health goes down.
http://www.geocities.com/cryect/damageblur.html



Edit: Oh and for those wondering about the info I got from Carmack here it is below

John Carmack wrote:
At 07:16 PM 9/3/2004 -0400, you wrote:

> Hi,
> Okay, I'm having an issue where I need the normal and binormals for a shader. Now the normal and one of the binormals is passed but the other binormal isn't (vertex.attrib[11]). For some reason its set to zero which I found strange. So I tried to generate the second binormal with the crossproduct of the other two, but of course thats wrong roughly half the time with it facing the wrong direction. So is that a bug for other shaders or is there another attribute this binormal is passed to? Thanks in advance and btw fragmentPrograms was the correct variable to check (though there isn't any use of it in the shaderDemos.mtr just letting you know).


Here is what you get:

qglVertexPointer( 3, GL_FLOAT, sizeof( idDrawVert ), ac->xyz.ToFloatPtr() );
qglTexCoordPointer( 2, GL_FLOAT, sizeof( idDrawVert ), reinterpret_cast<void *>(&ac->st) );
qglColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( idDrawVert ), (void *)&ac->color );
qglVertexAttribPointerARB( 9, 3, GL_FLOAT, false, sizeof( idDrawVert ), ac->tangents[0].ToFloatPtr() );
qglVertexAttribPointerARB( 10, 3, GL_FLOAT, false, sizeof( idDrawVert ), ac->tangents[1].ToFloatPtr() );
qglNormalPointer( GL_FLOAT, sizeof( idDrawVert ), ac->normal.ToFloatPtr() );


Edit: Fixed bugs with the shader

Share this post


Link to post

Alright well fixed bugs in the iridesecent shader causing its lookup to work incorrectly (forgot to swizzle the normals).

Also have included a material shader showing how it could be used for oil (hehe bright corn oil or something I guess :P)


Share this post


Link to post

Release a tutorial! I beg of you!

The oil looks awesome, and the zombies are quite psychadelic as they say!

Share this post


Link to post
WildWeasel said:

I'm surprised that id Software didn't put all this in in the first place.

They didn't put in a lot of things. It wasn't their intention to put in everything and the kitchen sink. Wait, there was a kitchen sink, never mind.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×