Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

madRenEGadE

Member Since 01 Feb 2006
Offline Last Active Jul 16 2012 02:13 AM
-----

Topics I've Started

Is this a valid usage for unions?

09 May 2012 - 12:25 PM

Hello all,

recently I decided to discard my hand-written math library code and use the GLM library.

Because I want to make it "feel" like my own code need some thin wrapper around it. Because performance matters I don't want to
write the wrapper using inheritance like this:

class Vector3 : public glm::dvec3
{
};

Now I have the idea to use a union and write code like this:

union Vector3
{
public:
	 Vector3(double x, double y, double z)
			: v(x, y, z)
    {
    }

    double x, y, z;

private:
    glm::dvec3 v;
};

Is this valid code (using C++11)?

Problem with deferred rendering

03 May 2012 - 01:59 PM

Hello all,

I am currently trying to implement a deferred renderer.
I am mostly following this tutorial: http://bat710.univ-lyon1.fr/~jciehl/Public/educ/GAMA/2007/Deferred_Shading_Tutorial_SBGAMES2005.pdf

Here are some screenshot from my current state. The test scene consists of two cubes and a point light.

1. This first screenshot looks correct
Posted Image

2. The second screenshot is taken from the opposite side. Here you can see that the cube which is further away overlaps the near cube:
Posted Image

3. Because I think this is a problem related to the depth buffer I rendered the depth buffer to the screen and everything was white. Then I manually created a texture and filled it with the z-values. The next two screenshots show this manually created depth texture:

Posted Image

Posted Image


Does anyone have an idea what the problem could be? If you need source code of specific parts just let me know.

Thx in advance.

PARTNERS