|
Re: Sky flag for camera-independent images
[Re: lyingmime]
#125804
08/03/07 17:54
08/03/07 17:54
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
I only need one view and to render it one time. Thats the purpose of the shader. It draws the models with that background image. Basically: I'm just changing the skin of the model to match the background image The depth info is already there. It's very easy and works quite well. The only problem I have now is that I'm a horrible level designer but seriously, the only problem I've run into is aligning the image with screen coords. This would't be a problem, if it weren't dependent on camera arc and resolution. The image needs to be aligned depending on the screen resolution and camera arc. While the resolution should be an easy [linear] equation, camera arc is quadratic, and through graphing has a noticable curve... I've got to remember how to find the formula, and get more statistics...
xXxGuitar511 - Programmer
|
|
|
Re: Sky flag for camera-independent images
[Re: Orange Brat]
#125806
08/04/07 04:56
08/04/07 04:56
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
Quote:
but seriously, the only problem I've run into is aligning the image with screen coords. This would't be a problem, if it weren't dependent on camera arc and resolution.
in our shader conversation we've been having, you may have missed it but i edited one of my posts saying i was no longer having aspect issues if the second camera was changed after the camera (or perhaps wait a frame after game start and then do it).
basically the matrix works fantastically.Code:
float4x4 matTexTrans = { 0.5f, 0.f, 0.f, 0.f, 0.f, -0.5f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.5f, 0.5f, 0.f, 1.f }
if you only use one view and render a background image over it, it'll automatically handle different arc, aspect, and resolution.
i hope this is helpful
julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Sky flag for camera-independent images
[Re: JibbSmart]
#125807
08/05/07 01:20
08/05/07 01:20
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
I must have missed that part...
Where/which coords do I multiply by the texture matrix though?
xXxGuitar511 - Programmer
|
|
|
Re: Sky flag for camera-independent images
[Re: xXxGuitar511]
#125808
08/05/07 01:44
08/05/07 01:44
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
matOutTex = mul(matWorldViewProj,matTexTrans); // this creates a matrix... OutPosTex = mul(InPos,matOutTex); // that converts the In.Position into appropriate coordinates for tex2Dproj to use in your PS.
julz
PS: i added your band on myspace
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Sky flag for camera-independent images
[Re: JibbSmart]
#125809
08/05/07 02:21
08/05/07 02:21
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
lol, thanks Julz. I'll make sure I confirm the add... You like the music? It's not so much of a band anymore, just me... Also, thanks for the matrix info. I'll have to try it out. Right now I'm busy with a paid project, so my 2.5D game is on pause... or should I say freeze_mode = 3;
xXxGuitar511 - Programmer
|
|
|
Re: Sky flag for camera-independent images
[Re: lyingmime]
#125811
08/08/07 19:18
08/08/07 19:18
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Adding an animation stream is nothing...
As I've said a million times before, it's not rendering in the background of the level, it's rendering onto thye level geometry, so the depth info is already there.
It's simply like changing the skin of the entity to match a background image
You can use whatever method you want for the BG image. I'm rendering a high quality version of the level, and then saving it to a TGA. Then the level is set to low quality and draws the old image.
It would be possible to input the depth I suppose. Such as writing the depth factor to the alpha channel. But then the case of rendering the depth properly becomes a problem...
xXxGuitar511 - Programmer
|
|
|
Re: Sky flag for camera-independent images
[Re: Orange Brat]
#125813
08/10/07 17:45
08/10/07 17:45
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
I wouldn't recommend usinbg it on blocks, but it would work... I'm working on a racing project with a small team for now, so all development of my project is on hold (I hvan't touched it in a week). If I can find time to work on the shader, then I'll clean it up and send it yo you (OB). You can mess with it freely... I just want credit for my work/time
xXxGuitar511 - Programmer
|
|
|
|