Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 7 1 2 3 4 5 6 7
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 Offline
Senior Expert
ventilator  Offline
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: ventilator] #16984
10/27/03 03:55
10/27/03 03:55
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
yup thast what im trying to work on..
im trying to take vecDiffuse and use to effect the vertex shader and somehow pass it on to the pixel shader.. but i just dont understand enough to do it. I dont get how it knows where to make the light a pure white value.. and how you can change that... i assume you have to put a "mul r0,-r0,c[vecdiffuse]" or something


Sphere Engine--the premier A6 graphics plugin.
Re: dot3 bumpmapping example [Re: Matt_Aufderheide] #16985
10/27/03 04:43
10/27/03 04:43
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
in the vertexshader you have to define vecdiffuse:
VertexShaderConstant[18]=<vecDiffuse>;

you can output vecdiffuse to oD1 in the vertexshader:
mov oD1,c18

and access it with v1 in the pixelshader:
mul_x2 r1,r1,v1 // modulate light intensity against vecdiffuse

Re: dot3 bumpmapping example [Re: ventilator] #16986
10/27/03 05:17
10/27/03 05:17
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
for some reason i cant get vecdiffuse to pass the rgb values..
however.. you can use vecLight.. that does it

thnx a lot for yor help vent..

now im going to try to add a specular component..


Sphere Engine--the premier A6 graphics plugin.
Re: dot3 bumpmapping example [Re: Matt_Aufderheide] #16987
10/27/03 09:51
10/27/03 09:51
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
can you describe how you assign multiple skins in Med?
I opened my model, with standard color map...then open skins, import dot3 skin and add the skin after the first...is that close?



Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: dot3 bumpmapping example [Re: Drew] #16988
10/27/03 10:05
10/27/03 10:05
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
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...

Re: dot3 bumpmapping example [Re: ventilator] #16989
10/27/03 10:18
10/27/03 10:18
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
excellent, thanks. works great! very bumpy



Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: dot3 bumpmapping example [Re: Drew] #16990
10/27/03 10:18
10/27/03 10:18
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
screenshot please!

Re: dot3 bumpmapping example [Re: ventilator] #16991
10/27/03 10:19
10/27/03 10:19
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
hey vent.. anotehr question
currently the shader doesnt respond to dynamic lights.. do you know how to add that? also you have any iea why veclight works but vec diffuse doesnt?


Sphere Engine--the premier A6 graphics plugin.
Re: dot3 bumpmapping example [Re: Matt_Aufderheide] #16992
10/27/03 10:25
10/27/03 10:25
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
currently the shader doesnt respond to dynamic lights.. do you know how to add that? also you have any iea why veclight works but vec diffuse doesnt?

vecdiffuse probably is 0 0 0 0 by default?

you have to find the nearest dynamic light yourself in your entity action and pass it as skill41. i guess the upcoming <new light management> will handle this a lot more convenient...

Page 5 of 7 1 2 3 4 5 6 7

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1