PDA

View Full Version : OpenGL color interpolation



plover
05-16-2001, 03:05 AM
When I render a 3D model in yellow color and want partial portion of the model is rendered with red color. I find OpenGL will interpolate the color at the color boundary so that the color change is smoothed and the boundary of the two color regions becomes "diffuse-like". How can I handle this problem. I think there are some possible solutions:

1.Subdivide the model (composed of triangular polygons) in the boundary region. I try this method and find it does not work well.

2.Use color buffer of depth buffer. I did not try yet about this method.

Is there any other good solution to this problem?

Thank you for your help for any comment.

chennes
05-16-2001, 04:24 AM
Turn off smooth shading.

Chris

lobstah
05-16-2001, 07:12 AM
Plover,
What are you modeling?

plover
05-16-2001, 06:32 PM
Hi~

Thank you for your response.

I have tried to turn off smooth shading but each triangular facet is rendered with single color. This is not the effect I want to be.

I try to explain my goal again.
I want to render a 3D model with a specified color, but I want to create a special effect like the model is spotted with red spots. I still want to render the model with smoothing effect but the boundary of the red spots should be reserved. How can I achieve this effect?

I try to render the model with yellow color first and then render the red spots. But the red spots disappear! I think maybe I need to use color a/o depth buffer but I have no idea to do in this way.

This seems a very simple common question but I did not find solution in FAQ. Hope any comment from you about this simple problem.(And I hope the solution is simple, too http://www.opengl.org/discussion_boards/ubb/smile.gif)

Deiussum
05-17-2001, 05:05 AM
Why not just use textures to put the red spots on the model?

Korval
05-17-2001, 12:00 PM
Create separate unique vertices where you want the junctions to be. Basically, its the same thing you would do if you wanted a crease to show up when you turned on lighting, except with colors instead of normals. It will change your stripping, because the two pieces will no longer be using the same vertices, but you won't see a break or anything.

Oleh Stepanenko
03-11-2011, 02:07 AM
I have some similar problem. I need to render such picture by means of OpenGL: [SCREEN] (http://5729.iz.piccy.info.nyud.net:8080/i5/29/57/1205729/screen.jpg)

I need to have a pallete with limited amount of colors and use colors from this pallete only. Can i avoid color smoothing and get such distinguished boundaries inside the polygons?

PS: Sorry for my terrible English)

mhagain
03-11-2011, 04:28 AM
Why not just use textures to put the red spots on the model?
Gets my vote.

V-man
03-11-2011, 05:28 AM
this is a 9 year old thread. let it die.