Showing posts with label shader. Show all posts
Showing posts with label shader. Show all posts

Tuesday, February 03, 2009

Simple Bulge Effect

Quite simple... Just add an equation before projecting the vertex position.

OUT.Position = IN.Position + ScaleFactor*0.5*(sin(IN.Position.y*Frequency*Time)+1) * IN.Normal.xyz;

The effect result is so so, but it's really interesting.


Another two animation effects in Cg Tutorial requires host application support, so I don't wanna study it now.

Sunday, February 01, 2009

Lighting Effect (Phong Model)

My implematation of Phong Lighting Model, refer to  Cg Tutorial Chapter 5, composed in FxComposer.

Below three pictures are captured in FxComposer. The Light is located at left-front-below position from the elephant, Light's direction to directly toward the elephant.
  1. Point Light, No Light Decay.

  2. Point Light, with Light Decay. The plane behind elephant is darker than front ones , as the Light is affected by distance between Light position and Vertex position. Refer to "Distance Attenuation" section of the tutorial.

  3. Spot Light, with Light Decay. Refer to "Adding a SpotLight Effect" section. This effect is more interesting than above two :)

Wednesday, January 21, 2009

Double Vision Effect

Just to congradulate my baby step of nVidia.Cg Effect composed in FX Composer.

No Effect -

Double Vision -


Get Source Code Here, this cgfx require Quad.cgh.

Wednesday, December 24, 2008

Mosaic Effect

Develop with RenderMonkey, refer to Someone's blog:

    

Get Source Code Here. (Not understand how to make RenderTarget work in FX Composor, so I just provide RenderMonkey project file here).
 

Wednesday, November 26, 2008

Blur and some Effects

Develop with RenderMonkey, refer to <Shaders for Game Programmers and Artists>:

  
 

Blur - Get Source Code Here.
EdgeDetection - Get Source Code Here.
Sharpening - Get Source Code Here.
Animated Texture - Get Source Code Here.
Motion Blur - Get Source Code Here. (not passed FX Composer Test, require fixing)

Tuesday, November 25, 2008