|
|
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
OP
Expert
|
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
OP
Expert
|
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: Excessus]
#129572
05/13/07 14:36
05/13/07 14:36
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
OP
Expert
|
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: ExtraCortex]
#129576
05/18/07 23:18
05/18/07 23:18
|
Joined: Oct 2006
Posts: 179
ExtraCortex
Member
|
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
Expert
|
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
|
|
|
|