Jump to content

  • Log In with Google      Sign In   
  • Create Account

necro1895

Member Since 26 Jun 2012
Offline Last Active Oct 11 2012 12:29 AM

Topics I've Started

Overlaying images in deferred rendering

29 July 2012 - 10:56 AM

Hy there,
i'm working on a small techdemo and i implemented the deferred renderer by cansin. Everything is working well so far. So i decided to modify it. I added a skysphere which is rendering onto a separate RenderTarget.

The final compositing shader overlays every drawn element on to the SkyMap.

float4 Color = tex2D(Diffuse, input.UV);  //gets DiffuseMap
float alpha = 1;		//calculate alpha
if (Color.a < 1)
alpha = 0;
float4 Lighting = tex2D(LightMap, input.UV); //gets LightMap
float4 Sky = tex2D(SkyMap, input.UV);   //gets SkyMap
//float4 output = float4(Color.xyz * Lighting.xyz + Lighting.w, 1);
float4 output = float4(Color.xyz * Lighting.xyz + Lighting.w, 1) * (1 - alpha) + tex2D(SkyMap, input.UV) * alpha;
output = float4(Color.xyz, 1) * (1-alpha) + tex2D(SkyMap, input.UV) * alpha;
return output;

As you can see i dont allow smooth alphavalues. They just can be 0 or 1. This kind of masking produces some outlines around every drawn object. I dont want that. You can see this behaviour on the attached screenshot. I know from blender, that this could be a problem with premultiplied values. But i dont know how i can do that in HLSL. So please give me some advices. Thats disturbing me..
Posted Image

Yet another BoundingFrustum-Thread

08 July 2012 - 08:02 AM

Hy there,
as you can read i still need some hints with the bounding-topics. Some quick information about the stuff i'm trying to do.
I'm coding a small planetary engine with procedural landscapes. Thats working well so far and so i want to implement view dependent LoD. That means i calculate each turn all patches which i have to render. To allocate the concerned patches i need the information whether the patch is in view frustum (camera view) or not.

My camera class is calculating the bounding frustum each turn via multiplying the view and projection matrix. You can see the matrices on the debug messages from the screenshots. The screenshots are showing three states.
1) - Start phase, the patch have to be rendered - you can see the bounding box of it
2) - I'm moving on the x-Axis but the patch is still in view
3) - I'm moving further on the x-Axis and the patch disappears from the view, but the BoundingFrustum doesnt detect that fact. You can see this on the bottom of the debug information (third-last line)

This behaviour is odd and i dont know why. There are less examples for the bounding-topic - especially for BoundingFrustum. So i have to ask you to share your experiences with that topic.

Please ask if you need more information or anything else.

Up vector is y-Axis, and i have a mouseLook camera which is calculating the view matrix from quaternions.

Posted ImagePosted ImagePosted Image

PARTNERS