Convert 2D Post Process targeting Cube Texture / Sky Box

Started by
1 comment, last by Meltac 9 years, 8 months ago

Hello guys,

I want to apply a post process shader effect (procedural starfield) that I have written to a sky box cube map, which is currently not really possible because the effect is made for pure 2D / screen space purposes. How would I convert or apply it to my sky shader which currently queries its color data using texCUBE()?

I'm working with DX9 and pure HLSL, no CPU-side / host application processing possible.

Any ideas?

Advertisement

the effect is made for pure 2D / screen space purposes

Why not taking the screen coords (2d in pixel shader, in DX9 take a look at VPOS) as input to your starfield algorithm while rendering the skybox.


Why not taking the screen coords (2d in pixel shader, in DX9 take a look at VPOS) as input to your starfield algorithm while rendering the skybox.

What do you mean by "screen coords"? My sky shader gets the UV input pixel coords (xy) which are the coords relative to the skybox, but I don't have the actual screen position of the current processed pixel in that context. Furthermore, if I had that wouldn't help because the sky then wouldn't rotate as it should when the camera moves.

I need to "draw" the generated starfield onto the skybox in order for it to display correctly under any conditions.

This topic is closed to new replies.

Advertisement