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
1 registered members (AbrahamR), 717 guests, and 4 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
vecLightDir issue #255178
03/08/09 13:18
03/08/09 13:18
Joined: Jul 2008
Posts: 18
Y
YNG Offline OP
Newbie
YNG  Offline OP
Newbie
Y

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.
Code:
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:
Code:
 
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:
Code:
 
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
Code:
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 Offline
Senior Expert
Quad  Offline
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
Y
YNG Offline OP
Newbie
YNG  Offline OP
Newbie
Y

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 Offline
Senior Expert
Quad  Offline
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
Y
YNG Offline OP
Newbie
YNG  Offline OP
Newbie
Y

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.
Re: vecLightDir issue [Re: YNG] #255257
03/09/09 08:29
03/09/09 08:29
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
This was a bug. The z component was indeed wrong. This will be fixed in the next update.

- Wow, 3 bugs in one day, and even real bugs, not just newbie problems! I think this is a record. smile

Re: vecLightDir issue [Re: jcl] #255286
03/09/09 10:51
03/09/09 10:51
Joined: Jul 2008
Posts: 18
Y
YNG Offline OP
Newbie
YNG  Offline OP
Newbie
Y

Joined: Jul 2008
Posts: 18
must be a possible consequence of developing a great engine for the community smile


Moderated by  jcl, Nems, Spirit, Tobias 

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