1 registered members (tomaslolo),
1,542
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
vecLightDir issue
#255178
03/08/09 13:18
03/08/09 13:18
|
Joined: Jul 2008
Posts: 18
YNG
OP
Newbie
|
OP
Newbie
Joined: Jul 2008
Posts: 18
|
For a project of mine i converted a per-pixel Spotlight shader to 3dgs .fx and at this process i think i found a bug at vecLightDir.
light1.dir = float3(vecLightDir[0].x, vecLightDir[0].y, vecLightDir[0].z);
At this line of my .fx file i tried every combination that could be, for a possible difference at 3dgs and hlsl vector. (***.X,***.Y,***.Z) (***.X,***.Z,***.Y) (***.Y,***.X,***.Z) (***.Z,***.X,***.Y) (***.Y,***.Z,***.X) (***.Z,***.Y,***.X) But at evry of them i encountered wrong results. Because of that i added these lines to the action of the shadered model at my script:
while(me!=NULL)
{
if(car != NULL)
{
vec_set(temp,vector(1,0,0));
vec_rotate(temp,car.pan);
vec_normalize(temp,1);
my.skill41 = floatv(temp.x);
my.skill42 = floatv(temp.y);
my.skill43 = floatv(temp.z);
my.skill44 = floatv(0.8);
}
wait(1);
}
And changed the line at my .fx file like this:
light1.dir = float3(vecSkill41.x, vecSkill41.z, vecSkill41.y);
And the shader gave the correct results. Also changing vecSkill41.x to vecLightDir[0].x and vecSkill41.z to vecLightDir[0].y
light1.dir = float3(vecLightDir[0].x, vecLightDir[0].y, vecSkill41.y);
doesn't disrupt the correct render. It seems there is something wrong with vecLightDir[0].z ...Wrong Result SS Right Result SS PS: I use version 7.70...
Last edited by YNG; 03/08/09 20:01.
|
|
|
Re: vecLightDir issue
[Re: YNG]
#255182
03/08/09 14:22
03/08/09 14:22
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
full shader code versen daha iyi olurdu.
bu arada düzgün newton araba yapabildiysen VET e iletirsen sevinirim.
3333333333
|
|
|
Re: vecLightDir issue
[Re: Quad]
#255203
03/08/09 18:54
03/08/09 18:54
|
Joined: Jul 2008
Posts: 18
YNG
OP
Newbie
|
OP
Newbie
Joined: Jul 2008
Posts: 18
|
vecLightDir i kullandigm tek satir o, o yüzden bu sekilde açikladim. Araba konusunda da araci yaptim ama biraz sIkIntIlI hala, çabuk kontrolu kaybedip spin atio bir de kasa ile tekerlekler ayni materiala sahip. Biraz kodu düzenliyim VET'e iletirim source u...
Last edited by YNG; 03/08/09 18:59.
|
|
|
Re: vecLightDir issue
[Re: YNG]
#255208
03/08/09 19:55
03/08/09 19:55
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
daha bi ton shader yazildi (ki hepsi lightdir veya lightpos kullanIyor illaki) ve bende ufak denemelerimde pek bir problemle karsilasmadim(herne kadar dircetional light kullanmamis olsamda).
Buyuk ihtimal zaten yapmissindir ama SPOTLIGT flagi acik degilse o isigin vecLigtDir inin bütün ögeleri 0 oluyor.
vecLightDir ile bi kac ufak deneme yapicam simdi.
Last edited by Quadraxas; 03/08/09 19:55.
3333333333
|
|
|
Re: vecLightDir issue
[Re: Quad]
#255210
03/08/09 19:58
03/08/09 19:58
|
Joined: Jul 2008
Posts: 18
YNG
OP
Newbie
|
OP
Newbie
Joined: Jul 2008
Posts: 18
|
yok yok hersey dogru yukarda da belirttim zaten tek sorun vecLightDir[...].Z de. X ve Y de bir sorun yok. Spotlight flaglari de var. %95 ihtimalle sorun vecLightDir[...].Z de, her türlü denemeyi yaptim ben.
Last edited by YNG; 03/08/09 19:59.
|
|
|
|