Quantcast
Channel: bugs, errors - openFrameworks
Viewing all articles
Browse latest Browse all 636

Problem with occlusion - binding images with alpha to 3d objects

$
0
0

@ttyy wrote:

I'm loading a png with transparency and binding that to a 3d box.

When viewed from certain angles, the interior of the box is not seen through the transparent part of the texture - instead, the background is drawn.
This changes depending on the camera angle. I'm wondering if this has to do with depth testing and if there's a workaround?

screenshots:

angle 1, interior occluded:

angle 2, bottom invisible:

my code:

ofEasyCam cam;
ofImage png;

void ofApp::setup(){
	ofBackground(50);

	png.load("img.png");

	ofEnableNormalizedTexCoords();
	ofEnableDepthTest();
}
void ofApp::draw(){
	cam.begin();

	png.bind();
	ofDrawBox(100);
	png.unbind();

	cam.end();
}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 636

Trending Articles