Asa
Asa

Reputation: 21

Making 3d Models Transparent in OpenGl and OpenFrameworks

I'm using c++ OpenFrameworks and ofx3dModelLoader to load in 3ds models that I've already created. This is working great. However I would like to smoothly transition models visually as the enter the frustum's back plane. I have fog working but would really like to fade the models in from transparency. Is there any way to do this either through openframeworks or opengl?

Upvotes: 2

Views: 1758

Answers (3)

jonbro
jonbro

Reputation: 353

I am not 100% sure how the 3ds loader works, but with most openframeworks drawing operations, you can alter the transparency of the drawing by setting ofSetColor();

In your case, you would set to (255, 255, 255, x) where x is the amount of transparency that you wanted to achieve.

Upvotes: 0

Rushyo
Rushyo

Reputation: 7604

You could handle this in the fragment shader. Simply change the output of the alpha on the output colour to 0.0.

Upvotes: 1

Jay
Jay

Reputation: 14471

You can change the alpha component of the texture applied to the objects. You might also search to see if there's a way to change the alpha component of a texture/object without redefining the entire texture.

Upvotes: 0

Related Questions