2 registered members (OptimusPrime, AndrewAMD),
14,580
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Post processing shaders at any resolution?
[Re: cwc]
#162616
10/22/07 19:50
10/22/07 19:50
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
I actually don't think non-available resolutions would make post processing impossible. But it depends on two options: - are you running in window mode ? ************* or ********************* - are you running in fullscreen mode ? Just to make it clear, there is is difference in use with video_set. In window mode, arbitrary video resolutions are supported as long as they fit on the desktop screen and sufficient video memory is available. For full screen mode, only a few video resolutions are supported, dependent on the 3D card. Further more there is one other aspect, I think trying it via video_switch is a better option because it supports up to 1920x1200 but then again you can't allowing arbitrary video resolutions like in video_set.For now, try setting it through video_switch, it seems the best option to work around the limited resolution reach from video_mode but a clear disadvantages is that you're bound to is the number that determines the screen resolution which is anti-arbitrary  Hope that helps, if not then I'm completly wrong  And you should ask other users who already have had experience with Sylex3 like Guitar. 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: Post processing shaders at any resolution?
[Re: cwc]
#162618
10/23/07 00:57
10/23/07 00:57
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
I'm no longer a fan of Sylex3. It's very dependant and not too stable. Try using the New render-to-texture (RTT) DLL that was posted in the User Contributions. It'll take more coding, but it's well worth it  EDIT: Oh, and to answer your question, as far as I know, Sylex3 doesn't support using any video modes other than the default. There's an english translation of the manual floating around here somewhere if you need it...
Last edited by xXxGuitar511; 10/23/07 00:59.
xXxGuitar511 - Programmer
|
|
|
Re: Post processing shaders at any resolution?
[Re: cwc]
#162620
10/24/07 01:43
10/24/07 01:43
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Yeah, one thing  ...You don't render it onto a panel, that would be too easy  . You need to render it to a screen entity; using an image as the entity. Then you just need to properly align it.
xXxGuitar511 - Programmer
|
|
|
Re: Post processing shaders at any resolution?
[Re: cwc]
#162622
10/24/07 17:04
10/24/07 17:04
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
haha, I know exactly what you mean  It's not too difficult to align it properly, and as long as you use a view entity (below) it should work fine. I figured out a little (linear) equation for adjusting the scale to meet the screen, I'll post it here when I get home 
xXxGuitar511 - Programmer
|
|
|
Re: Post processing shaders at any resolution?
[Re: xXxGuitar511]
#162623
10/25/07 00:34
10/25/07 00:34
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
alignment isn't even necessary  well, not perfect alignment. as long as it covers the entire screen, then you can texture it in screen-space (does this ring any bells, guitar?) just looking through my stuff... Code:
const float4x4 matWorldViewProj; // World*view*projection matrix. const float4x4 mat2Tex = { 0.5f, 0.f, 0.f, 0.f, 0.f, -0.5f, 0.f, 0.f, 0.f, 0.f, 1.0f, 0.f, 0.5f, 0.5f, 0.f, 1.0f };
texture mtlSkin1; sampler ScreenSampler = sampler_state { Texture = <mtlSkin1>; AddressU = Clamp; AddressV = Clamp; };
void ScreenMapVS( in float4 InPos : POSITION, in float4 InNormal : NORMAL, out float4 OutPos : POSITION, out float4 OutTex : TEXCOORD0, out float4 OutNormal : TEXCOORD1 ) { OutPos = mul(InPos, matWorldViewProj); float4x4 matOffset = mul(matWorldViewProj,mat2Tex); OutTex = mul(InPos,matOffset); OutNormal = InNormal; }
float4 ScreenMapPS( in float4 InTex : TEXCOORD0, in float4 InNormal : TEXCOORD1, in float4 InPos : TEXCOORD2) : COLOR { float4 sPos = InTex; float4 colScreen = tex2Dproj(ScreenSampler,sPos); colScreen.bg = 0; return colScreen; }
technique Project2ScreenTechnique { pass P0 { VertexShader = compile vs_2_0 ScreenMapVS(); PixelShader = compile ps_2_0 ScreenMapPS(); } }
this is pretty basic. mat2Tex is just a matrix that, when multiplied by matWorldViewProj, will give a matrix that, when multiplied by the object's coordinates as passed to the vertex shader, will convert its screen coordinates to texture coordinates. these can be used when sampling the texture, which in my example is given by a render-to-texture by a view that's identical to the camera (those details aren't in my example... it's just basic RTT). the blue and green components are removed so you can see where the object is in this example. this'll be a tad easier in the next update... can't wait!!  here the shader has been applied to a sphere. if you have a view-entity easily covering the whole screen, then you won't have to worry about adjusting the model for different screen-ratios, camera arcs, etc. the shader will handle that. as long as both views have identical properties. Quote:
the alignment problem itself being one and another being slight image distortions that inevitably result from inevitably imperfect screen alignment.
this'll sort that out 
julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|