Cryect Posted September 4, 2004 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 0 Share this post Link to post
Linguica Posted September 4, 2004 Haha, that blurring thing is awesome. Pixel shaders are the best thing since hardware acceleration. 0 Share this post Link to post
Cryect Posted September 5, 2004 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) 0 Share this post Link to post
Joe Posted September 5, 2004 Release a tutorial! I beg of you! The oil looks awesome, and the zombies are quite psychadelic as they say! 0 Share this post Link to post
AirRaid Posted September 5, 2004 Because every office has a small vat of oil sunken into the floor. :P Heh, awesome work. 0 Share this post Link to post
wildweasel Posted September 5, 2004 I'm surprised that id Software didn't put all this in in the first place. 0 Share this post Link to post
Linguica Posted September 5, 2004 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. 0 Share this post Link to post