View Full Version : Question on Texture
11-22-2011, 01:30 AM
I am a undergrad student just becoming familiar with OpenGL. I have some very basic question on OpenGL. I want to know about texture. Can I derive the RGB value from a texture and then use it for coloring a polygon? Will it give the same output like original texture?
11-22-2011, 04:03 AM
Can I derive the RGB value from a texture and then use it for coloring a polygon
I'm not 100% sure what you're asking here.
Are you saying that you want to sample the texture and then manipulate it in some way and then output the results of that calculation? Yes you can do that. It's called a fragment shader - you can do what ever you want in one of those.
Will it give the same output like original texture
The frament shader will give the same output results like basic texturing if you want it to. it's up to you really.
11-22-2011, 07:21 PM
Thank you for answer. Can you please tell me how fragment shader can be used? Is any tutorial on it available?
11-23-2011, 03:39 AM
You could try this site. There are many tutorial sies on the net - just search.
HeNe offer OpenGl tutorials as well, as does LightHouse3d...
11-24-2011, 01:12 AM
Thanks for the link provided. I want to do something like this. In my texture, there are some white portions. I want to separate them from the rest of the colored part. Can't I do it without fragment shader?
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.