Rendering depth buffer and blending it to a texture?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Downsider002
Posts: 3
Joined: Wed Jun 10, 2009 5:50 am

Rendering depth buffer and blending it to a texture?

Post by Downsider002 »

Okay.

So I've got a decent looking flashlight loading and displaying, but I've got a problem. It doesn't exactly fade when it reaches distant walls, so I thought, why not take the depth buffer and blend it with the texture? This seemed like the best way to go about doing it.

Unfortunately, I don't know:

1) How to render the depth buffer
2) The best way to blend it with the existing texture

Can anybody help me out here?
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

When you set up the GU you allocates the Depth Buffer.

Can't you read that buffer since you have the pointer to the depth buffer?

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You might try searching the threads here - I remember an old thread on using the depth buffer.
Downsider002
Posts: 3
Joined: Wed Jun 10, 2009 5:50 am

Post by Downsider002 »

Thanks for the info. I'll look around!
Post Reply