Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


3d paint

This topic is 5922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve been experimenting with 3d painting recently, as I plan to make an open source 3d painter. But have come into trouble with an approach I''m using. I was generating an image where each pixel has a unique color. Then drawing the mesh using this unique image as the texture. The idea was to then glReadPixels and find the color where the mouse is, then search for this color on the unique texture. This way finding the uv coordinates for where the mouse was clicked( the place on the texture the user plans to paint). However it turns out that the color returned is not quite what it should be. I have disabled GL_BLEND, GL_DITHER, GL_FOG, GL_LIGHTING, so that they may not make the color of my choosing different. To stop interpolation of the texture I have used: glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST) glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST) I have set glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL) None of this seems to work, so I fear the worst. Can someone please help me in this, with suggestions on how to fix this problem or to suggest another method?

Share this post

Link to post
Share on other sites
possibly you lost somehwere precision with for example 16bit colormode, or 16bit texturecolormode, dunno..

you using GL_RGB8 for glTexImage2D or 3 at the... 3rd? parameter..

have no other idea, but my brain is not working properly caused by the fever currently.. possibly i have more tips when its away in some days..

"take a look around" - limp bizkit

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!