Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, AndrewAMD), 1,112 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
skies and matWorld #421362
04/16/13 07:15
04/16/13 07:15
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hi,

when setting a pan != 0, my skycubes won't change. I wrote then a simple shader to sample from the sky as cubemap:

Code:
effect_load(mtl_sky, "skyCube.fx");

g_entSky = ...
bmap_to_cubemap(bmap_for_entity(g_entSky, 0));


Code:
Out.Pos = mul(In.Pos, matWorldViewProj);
Out.Tex = (mul(float4(In.Pos.xyz, 1), (float4x4)matWorld)).xyz - vecViewPos.xyz;

...

return float4(texCUBE(skin, normalize(In.Tex)).rgb, 1);



The skycube is rendered as desired, but when changing the pan of my sky entity, it doesn't rotate, so it seems to me that matWorld isn't properly set.

Is this intended or a bug?, I dont know smile

Re: skies and matWorld [Re: HeelX] #421363
04/16/13 07:49
04/16/13 07:49
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Skies are backgrounds, they have no world matrix AFAIK.

Re: skies and matWorld [Re: jcl] #421388
04/16/13 12:35
04/16/13 12:35
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
I just want to rotate my skycube, like I can do if it is a CYLINDER, because the sun is in a wrong place. So, I guess I have to build my rotation matrix by myself.

Re: skies and matWorld [Re: HeelX] #421389
04/16/13 12:59
04/16/13 12:59
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes. The sky cube is internally generated just from 6 sprites. You can relatively easily emulate that either with normal sprites, or with a cube model that you can then also rotate.

Re: skies and matWorld [Re: jcl] #421396
04/16/13 14:45
04/16/13 14:45
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hm, there must be a world matrix because if it were an identity-matrix,
Code:
float3 vec = (mul(float4(In.Pos.xyz, 1), (float4x4)matWorld)).xyz - vecViewPos.xyz;

would be reduced to
Code:
float3 vec = In.Pos.xyz - vecViewPos.xyz;


but this doesn't work for me.

On the other hand, I face other problems: when I replace matWorldViewProj in my calculation of Out.Pos with
Code:
mul(matWorld, matViewProj)



The sky gets clipped:


This doesn't happen, when I concatenate matWorldView with matProj like this:
Code:
mul(matWorldView, matProj)



Moderated by  old_bill, 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