Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 10:32
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 604 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Texture to Screen space...? #129569
05/12/07 21:15
05/12/07 21:15
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline OP
Expert
xXxGuitar511  Offline OP
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
I'm trying to render my objects texture onto the screen, but also only from the models area. Like a Portal .

here's an example: (Video may not be up yet, as I just uploaded and youtube is slow) TexToScreen [YouTube]

It should be pretty simple, I just can't quite figure it out myself ATM...


xXxGuitar511
- Programmer
Re: Texture to Screen space...? [Re: xXxGuitar511] #129570
05/12/07 23:10
05/12/07 23:10
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline OP
Expert
xXxGuitar511  Offline OP
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Ok, different name, same thing...

I need to convert the pixels to view space, but nothing turns out right.

Code:

VertexShader
{
...
Out.Pos = mul(In.Pos, matView);
...
}
//
PixelShader
{
...
outColor = tex2D(imageTex, In.Pos);
...
}



Last edited by xXxGuitar511; 05/12/07 23:10.

xXxGuitar511
- Programmer
Re: Texture to Screen space...? [Re: xXxGuitar511] #129571
05/13/07 07:15
05/13/07 07:15
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
I don't really understand what you're trying to do, but in any case, if you want to render on the screen area of the model, you must transform the vertices with matWorldViewProj, or the area that is rendered to will be incorrect.

Re: Texture to Screen space...? [Re: Excessus] #129572
05/13/07 14:36
05/13/07 14:36
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline OP
Expert
xXxGuitar511  Offline OP
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
I figured it out. Here's a simple example of how it goes:

Code:

VertexShader
{
...
Out.Pos = mul(In.Pos, matWorldViewProj).xyz;
...
}
//
PixelShader
{
...
float2 tPos = (In.Pos.xy / In.Pos.z) + 0.5;
outColor = tex2D(imageTex, nPos);
...
}



Last edited by xXxGuitar511; 05/13/07 14:37.

xXxGuitar511
- Programmer
Re: Texture to Screen space...? [Re: xXxGuitar511] #129573
05/17/07 09:52
05/17/07 09:52
Joined: Oct 2006
Posts: 179
ExtraCortex Offline
Member
ExtraCortex  Offline
Member

Joined: Oct 2006
Posts: 179
How can i implement that code to the model's action?

Re: Texture to Screen space...? [Re: ExtraCortex] #129574
05/17/07 09:55
05/17/07 09:55
Joined: Oct 2006
Posts: 179
ExtraCortex Offline
Member
ExtraCortex  Offline
Member

Joined: Oct 2006
Posts: 179
Can you send me the project has example?

Re: Texture to Screen space...? [Re: ExtraCortex] #129575
05/18/07 18:32
05/18/07 18:32
Joined: Oct 2006
Posts: 179
ExtraCortex Offline
Member
ExtraCortex  Offline
Member

Joined: Oct 2006
Posts: 179
help me...

Re: Texture to Screen space...? [Re: ExtraCortex] #129576
05/18/07 23:18
05/18/07 23:18
Joined: Oct 2006
Posts: 179
ExtraCortex Offline
Member
ExtraCortex  Offline
Member

Joined: Oct 2006
Posts: 179
:'(

Re: Texture to Screen space...? [Re: ExtraCortex] #129577
05/19/07 16:21
05/19/07 16:21
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Maybe you better try to send a pm to xXxGuitar511 because I don't think he's checking this tread anymore

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Texture to Screen space...? [Re: frazzle] #129578
05/19/07 22:34
05/19/07 22:34
Joined: Oct 2006
Posts: 179
ExtraCortex Offline
Member
ExtraCortex  Offline
Member

Joined: Oct 2006
Posts: 179
I sent some days ago, he didnt read it yet.

Can someone give me xXxGuitar511 email trought PM?

Page 1 of 2 1 2

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