Click here to Skip to main content
16,005,236 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDoes OpenGL do alpha or not? Pin
Swinefeaster4-Nov-05 11:30
Swinefeaster4-Nov-05 11:30 
AnswerRe: Does OpenGL do alpha or not? Pin
Graham Shanks4-Nov-05 12:26
Graham Shanks4-Nov-05 12:26 
AnswerRe: Does OpenGL do alpha or not? Pin
El Corazon4-Nov-05 19:31
El Corazon4-Nov-05 19:31 
GeneralRe: Does OpenGL do alpha or not? Pin
vikas amin5-Nov-05 1:22
vikas amin5-Nov-05 1:22 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster7-Nov-05 8:55
Swinefeaster7-Nov-05 8:55 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon7-Nov-05 9:16
El Corazon7-Nov-05 9:16 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster7-Nov-05 12:41
Swinefeaster7-Nov-05 12:41 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon7-Nov-05 13:57
El Corazon7-Nov-05 13:57 
Swinefeaster wrote:
Well that's the whole thing really. The user can set the camera angle viewpoint anywhere they want, inherently reversing the order of the objects in my scene. So I need a generic way of sorting these objects by calculating the depth from the camera.


Well, yes and no. OpenGL is a programming API, so it is designed for your flexibility and power, but it is very low-level. If you are trying to make sure a user can drive a car, OpenGL is the transmission and engine block. When you start talking about making it easy for the user, you are talking higher level stuff, you are talking scene-graphs and gaming engine APIs.


Swinefeaster wrote:
I would have liked most to have a general sort for this. I guess there's no OpenGL option I can enable for this, huh?


Use any sort. OpenGL doesn't remember objects from frame to frame, in fact it doesn't even have any knowledge of "objects" per se. OpenGL knows triangles and can draw them in many different references with multiple textures, color blending methods, etc. But OpenGL doesn't know a car from a baseball bat. If you build a vector using STL and sort it using your favorite sort, you have your beginnings of a gaming engine/storage system. If you want to drop something in and not have to repeat it again everyframe forever, again you are talking scene graphs. nVidia has a scene graph, there is several open scene graphs (though only one by that name).


Swinefeaster wrote:
And what if you don't know (or don't wanna know) why objects are transparent and which are not...? Or what if some objects are partially transparent or have gradient alphas?


Again, you are talking scene graph material. OpenGL knows the basics, triangles, lines, points, colors, textures, etc. Even the shaders are fancy ways of coloring a triangle. Don't get me wrong, both DirectX and OpenGL are incredibly powerful, but they are much lower level than you are talking about.

With open scene graph you do just drop an object (not triangle lists, but a physical object) into a node. The scene graph breaks the object into triangles of opaque and transparent nature and zsorts appropriately. You then move the object as you would moving a plane or a car, or a cartoon character, by manipulating centers of parts (rotate, translate, scale, etc). With a scene graph or gaming engine, you think in object/part rather than every triangle. Although a single point, or a single triangle is still considered an object, so you can always go lowerlevel from the high.

Jeff



_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster14-Nov-05 15:40
Swinefeaster14-Nov-05 15:40 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon14-Nov-05 17:08
El Corazon14-Nov-05 17:08 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster15-Nov-05 8:49
Swinefeaster15-Nov-05 8:49 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon15-Nov-05 16:17
El Corazon15-Nov-05 16:17 
QuestionLPSAFEARRAY issues Pin
Axonn Echysttas4-Nov-05 9:46
Axonn Echysttas4-Nov-05 9:46 
AnswerRe: LPSAFEARRAY issues Pin
Mircea Puiu4-Nov-05 23:31
Mircea Puiu4-Nov-05 23:31 
GeneralRe: LPSAFEARRAY issues Pin
Axonn Echysttas5-Nov-05 10:51
Axonn Echysttas5-Nov-05 10:51 
GeneralRe: LPSAFEARRAY issues Pin
Axonn Echysttas5-Nov-05 21:23
Axonn Echysttas5-Nov-05 21:23 
QuestionLinker Error Pin
Maskarat4-Nov-05 7:54
Maskarat4-Nov-05 7:54 
AnswerRe: Linker Error Pin
Blake Miller4-Nov-05 10:49
Blake Miller4-Nov-05 10:49 
GeneralRe: Linker Error Pin
Maskarat6-Nov-05 4:01
Maskarat6-Nov-05 4:01 
QuestionHelp me :What is wrong here???? Pin
Member 18584504-Nov-05 7:26
Member 18584504-Nov-05 7:26 
QuestionRe: Help me :What is wrong here???? Pin
David Crow4-Nov-05 7:51
David Crow4-Nov-05 7:51 
QuestionA different registry question - edit offline? Pin
charlieg4-Nov-05 7:24
charlieg4-Nov-05 7:24 
QuestionRe: A different registry question - edit offline? Pin
David Crow4-Nov-05 7:50
David Crow4-Nov-05 7:50 
AnswerRe: A different registry question - edit offline? Pin
charlieg4-Nov-05 8:03
charlieg4-Nov-05 8:03 
QuestionRe: A different registry question - edit offline? Pin
David Crow4-Nov-05 8:08
David Crow4-Nov-05 8:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.