/*********************************************************************NVMH3**** File: $Id: //sw/devtools/SDK/9.5/SDK/MEDIA/HLSL/pre_opto.fx#3 $ Copyright NVIDIA Corporation 2002 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Comments: Op-Art fun as a background Geometry Ignored ******************************************************************************/ #include #include float Script : STANDARDSGLOBAL < string ScriptClass = "scene"; string ScriptOrder = "preprocess"; string ScriptOutput = "color"; string Script = "Technique=OpArt;"; > = 0.8; // version # float ClearDepth = 1.0; float Scale < string UIName = "Scale"; string UIWidget = "slider"; float UIMin = 0.01; float UIMax = 64.0; float UIStep = 0.01; > = 32.0f; float WScale < string UIName = "Wave Scale"; string UIWidget = "slider"; float UIMin = 0.01; float UIMax = 32.0; float UIStep = 0.01; > = 20.0f; float Pinch < string UIName = "Pinch"; string UIWidget = "slider"; float UIMin = 0.01; float UIMax = 2.0; float UIStep = 0.01; > = 1.0f; float OffsetX < string UIName = "Offset X"; string UIWidget = "slider"; float UIMin = -2; float UIMax = 2; float UIStep = 0.01; > = 0.5f; float OffsetY < string UIName = "Offset Y"; string UIWidget = "slider"; float UIMin = -2; float UIMax = 2; float UIStep = 0.01; > = 0.5f; float4 c1 < string UIWidget="color"; > = {1,.3,.8,1}; float4 c2 < string UIWidget="color"; > = {.4,1,.3,1}; ////////////////////// QUAD_REAL4 optoPS(QuadVertexOutput IN) : COLOR { float2 nuv = Scale * IN.UV; nuv.x = nuv.x + Pinch*sin(OffsetX+WScale*(IN.UV.x)); nuv.y = nuv.y + Pinch*sin(OffsetY+WScale*IN.UV.y); QUAD_REAL c = checker2D(nuv); return lerp(c1,c2,c); } //////////////////////// technique OpArt < string Script = "Pass=p0;"; > { pass p0 < string Script = "ClearSetDepth=ClearDepth;" "Clear=Depth;" "Draw=Buffer;" "ScriptExternal=Scene;"; > { cullmode = none; ZEnable = false; ZWriteEnable = false; VertexShader = compile vs_2_0 ScreenQuadVS(); PixelShader = compile ps_2_a optoPS(); } } /***************************** eof ***/