per pixel phong material

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

per pixel phong material

Post by needforhint »

get it here:http://www.medeal.sk/irr/phongPERpixel.zip (have to see it in move)

here is a per pixel shader doing a phong effect, during trying to set right call back constants I discovered bad behaviors of irrlicht world,view and projection matrices...so main.cpp is in if anyone had such trouble (compiled on irrlicht 0.14), the pixel and vertex shaders are 2.0 so only ATI 9X00 and higher and GeForce(some good one)

Image

by the way, per pixel spot light is on the way :twisted:
what is this thing...
omaremad_

Post by omaremad_ »

Nice work

Btw youre gonna have touble implementing that spotlight since the cjeapest way to do it is via cube maps(which are not suppourted by irrlicht)


what u do is get a cube map which is black except a circle on one of the sides

Multiply it by the color of the light then the base texture

the texcoord of the cube maps is composed of three vectors not 2 therefore u can use the light source as the texcoord of the cube map
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

thanks,

I have a question for u omaremad, have you ever implemented 2 textures into a shader with irrlicht?
[SOLVED: YES , CAN]
what is this thing...
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

did u use a shader call back with integers sent by the sampler 2d names

i never used 2 texture in hlsl i only used it in my HDR glsl
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

I didnt set texture in callback. Both, layer 1 and layer 2 texture were automaticly mapped into hlsl, I used sampler2d definition-.
what is this thing...
Post Reply