|
2 registered members (AndrewAMD, 1 invisible),
4,602
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: dot3 bumpmapping example
[Re: Matt_Aufderheide]
#16983
10/27/03 03:23
10/27/03 03:23
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
the simplest solution would be to just add a constant for the light color in the pixelshader:
Code:
PixelShader=
asm
{
ps.1.3
def c0,0.3,0.3,0.9,1.0 // light color rgba
tex t0 // sample colormap
tex t1 // sample normalmap
dp3 r1,t1_bx2,v0_bx2 // normal . light
mul r1,r1,c0 // modulate light intensity against light color
mul r0,t0,r1 // modulate light against color(t0)
};
(i haven't tested it! instead of mul r1,r1,c0 you could also try mul_x2 r1,r1,c0 or something like that...)
if you want to pass the color from outside of the shader it gets a little more complicated. i guess then you would have to pass it first to the vertex shader and from there to the pixelshader...
|
|
|
Re: dot3 bumpmapping example
[Re: Drew]
#16988
10/27/03 10:05
10/27/03 10:05
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
yes, close!
if you open med's skin editor you should see your color map.
then do the following:
1. edit -> add new skin -> after last skin
2. switch to the second skin with the <next skin> icon
3. import your normalmap - it doesn't matter if you adapt the skin vertices or not
4. edit -> convert skin -> add mipmaps
5. save your model
normally information about which texture you are currently looking at should be visible in the statusbar. but there is a bug in the current version of med...
|
|
|
|