OpenGL color interpolation

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.

Turn off smooth shading.

Chris

Plover,
What are you modeling?

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 )

Why not just use textures to put the red spots on the model?

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.

I have some similar problem. I need to render such picture by means of OpenGL: [SCREEN]

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)

Gets my vote.

this is a 9 year old thread. let it die.