• Advertisement

Archived

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

OpenGL OpenGL 1.3, 2.0 & DirectX 9

This topic is 6241 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

Hey hey Long post, be weary. Also, this is not another DX OGL war. I''ve been reading about OpenGL quite extensivley latley, and I''ve liked what I''ve been reading. I''ve heard OpenGL 1.3 (or 2.0, as some call it) is either in development or ready for release - how so, in what form? I''ve read that windows 9x only supports 1.1, and I''m ill-informed about the NT(2K) implications of the graphics technology (does 2k support 1.2?) I''ve recently become an OpenGL advacist, and I was wondering how its progressing (in terms of 1.3). It just seems like such a noble API, yet I''m let down by it''s lack of support from the so called committee thats standardizing it. Remember now this is all opinion, and I''m probably misinformed on quite a few things here, but hopefully someone can clear this up for me and anyone passing through. I would also like to ask what input, sound, and newotrking API people use when doing 3D in OpenGl. I''ve been using DirectX for about 5 months now, learning windows multimedia along with the API, and now have a grudge against anything that approaches me that even LOOKS like COM. I''ve read people don''t use DirectX (as adversed to OpenGL) for 3d Graphics because many dislike COM. If thats the case, do they yield to these objections when they need something advanced to handle sound and input, or is there another input/sound API that I don''t know about? Just an inquiry. As of now I think people that use OpenGL for 3D graphics use OS independent sound routines and input routines (which CAN''T be right). Too much work in my opinion. Another thing, DX9 - can anyone speculate if this will be the version that D3D compares to OpenGL in functionality and (ease of use). I say this because I don''t ever think D3D will surpass OpenGL in ease of use because of the methods MS uses to get everything done (my 2D dos graphics engine was easier to use, and that was a mess). I only make this inquiry from what I''ve read - I don''t know the gritty details of either API''s 3D capability, but I''ve seen some comparisons in capabilities between both API''s by technical gurus. DX8 is agreed to be (by most) a heavy advancement in MS'' directX in terms of ease of use and functionality, but many say it''s still deriving most of its functionality from OpenGL. In this posters opinion, if DX9 is the significant progression that DX8 was (in terms of 3D) then I think the market will shift in favor of DX9. Personally I don''t want D3D to ever surpass OGL in capability and ease of use (although I think D3D has passed it in terms of standardization) but reality says that through MS'' frequent updates they''re making DX better and better, in which OGL can''t compare...... which is why I asked the question in this topic in the first place - OpenGL''s "soon to be" update. If anyone can shed any information on 1.3 (or 2.0, whichever) I''d be thankful for the information. BTW, after reading through my post I think I''ve treaded on a lot of sensitive territory, and ask any corrections be posted (I''m new to the subject, flames wouldn''t really help me... =) Adios -Phil Crosby www.philisoft.com www.graphics-design.com

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by -TheDragon

and I''m ill-informed about the NT(2K) implications of the graphics technology (does 2k support 1.2?)


I''m running Win2k. It supports GL fine. And NT supports GL, where as it only supports up to DX 3 or 5 I think.

quote:

I would also like to ask what input, sound, and newotrking API people use when doing 3D in OpenGl.


I personally use DX for sound & input, havn''t touched networking yet.

quote:

I''ve been using DirectX for about 5 months now, learning windows multimedia along with the API, and now have a grudge against anything that approaches me that even LOOKS like COM. I''ve read people don''t use DirectX (as adversed to OpenGL) for 3d Graphics because many dislike COM. If thats the case, do they yield to these objections when they need something advanced to handle sound and input, or is there another input/sound API that I don''t know about? Just an inquiry. As of now I think people that use OpenGL for 3D graphics use OS independent sound routines and input routines (which CAN''T be right). Too much work in my opinion.


There are a lot of 3rd party librarys out there such as OpenAL, OpenNL, OpenIL, etc that people tend to use.

quote:

Another thing, DX9 - can anyone speculate if this will be the version that D3D compares to OpenGL in functionality and (ease of use). I say this because I don''t ever think D3D will surpass OpenGL in ease of use because of the methods MS uses to get everything done (my 2D dos graphics engine was easier to use, and that was a mess). I only make this inquiry from what I''ve read - I don''t know the gritty details of either API''s 3D capability, but I''ve seen some comparisons in capabilities between both API''s by technical gurus. DX8 is agreed to be (by most) a heavy advancement in MS'' directX in terms of ease of use and functionality, but many say it''s still deriving most of its functionality from OpenGL.


D3D in DX8 has finally become quite a good and usable API. It''s practically as easy to use as OGL.

quote:

In this posters opinion, if DX9 is the significant progression that DX8 was (in terms of 3D) then I think the market will shift in favor of DX9. Personally I don''t want D3D to ever surpass OGL in capability and ease of use (although I think D3D has passed it in terms of standardization) but reality says that through MS'' frequent updates they''re making DX better and better, in which OGL can''t compare......

I agree, the GL ARB needs to get off their @ss and do something for GL

quote:

which is why I asked the question in this topic in the first place - OpenGL''s "soon to be" update. If anyone can shed any information on 1.3 (or 2.0, whichever) I''d be thankful for the information. BTW, after reading through my post I think I''ve treaded on a lot of sensitive territory, and ask any corrections be posted (I''m new to the subject, flames wouldn''t really help me... =)

I havn''t heard anything about 1.3(2.0?), but I''ll look forward to it

Share this post


Link to post
Share on other sites
The official story is that Win98 does not "support" OpenGL 1.2, Win2K does.

Not really. Both systems will happily run OpenGL 1.2 if your drivers support it. However, OpenGL32.dll on Win98 does not expose the new 1.2 functions (such as glTexImage3D() ). If you want to use these on Win98, you have to load them yourself using wglGetProcAddress() .

I just have to ask: where did you hear about GL 1.3 or 2.0?

- Tom

Share this post


Link to post
Share on other sites
Quantum, thanks for the OpenAL and OpenNL information, I''ll look into those. Are they as standard and compatible as their directx counterparts (to the extent that openGL is)? Also, I know 2k supports OpenGL, I was asking if it supported 1.2
And Delphi you answered that thoroughly.

I heard about 1.3 in a few places around this board, either posted many times by the same person in different places, or mentioned by a few people - might have been in the dx vs ogl war post. I remember someone saying that some app was soon to be released, "and it might ship with OGL 1.3 (2.0?)" something to that accord.

BTW, I''ve started coding OpenGL... and my code looks so purty =) Die COM.

-Phil Crosby
www.philisoft.com
www.graphics-design.com

Share this post


Link to post
Share on other sites
ya i used to think that non-COM code was pretty, so i didn''t like directX, but I got over it. Now i think COM code looks pretty

Share this post


Link to post
Share on other sites
Remember than DirectX 9 won''t run in Windows 9x (from what I''ve heard), only on Win2K and Whistler (Whistler sounds like a good OS except for MS''s intrustive anti-piracy scheme, it will be able to use double buffering for your desktop, heh).

OpenGL 1.3/2.0 will run in Windows somehow, if it doesn''t someone will make drivers for it, then it will . I''m seriously thinking of dual booting Linux/Win2K so I don''t have to worry about MS''s insane ideas about Whistler, so I''m sure I''ll get OpenGL to work in one OS, heh.



http://www.gdarchive.net/druidgames/

Share this post


Link to post
Share on other sites
quote:
Original post by PSioNiC

ya i used to think that non-COM code was pretty, so i didn''t like directX, but I got over it. Now i think COM code looks pretty


Are you on crack?

LPTHISVARIABLENAMEISLONG (c''mon people this get''s annoying)
and the fact that I have to pass pointers to the D3DDevice every time I instantiate a new light/texture/model/whatever class from my encapsulation so that I can render is b/s. The fact that I can call glClear() from any one of my classes or mehtods without any variable passing nonsense makes my world a happy place.

~S''Greth

Share this post


Link to post
Share on other sites
quote:
Original post by SGreth
Are you on crack?


That has nothing to do with liking COM. Just because people actually show some sign of liking something that Microsoft did does not automatically make them a drug addict or a loser. Grow up.
quote:

LPTHISVARIABLENAMEISLONG (c''mon people this get''s annoying)
and the fact that I have to pass pointers to the D3DDevice every time I instantiate a new light/texture/model/whatever class from my encapsulation so that I can render is b/s. The fact that I can call glClear() from any one of my classes or mehtods without any variable passing nonsense makes my world a happy place.



Firstly, this makes it clear to me that you seem not to understand what COM is all about. And also, the LPDIRECT3DDEVICE8 or LPDIRECTINPUTDEVICE8 and such variable names are nothing to do with COM, they are Hungarian Notation. At least Microsoft programmers are consisitent with their notation, and do not mess us about by giving their types unclear names or in lower case letters. The common practice is to make structure tag names, typedefs and enums all upper case letters, and the programmers are only following that convention. You do not have to pass a pointer to the D3DDEVICE. You could:
a) make it global
b) encapsulate it in a class and make the class global

I suggest you study COM further (OLE Controls and the like) to see exactly why it is how it is. Then you might understand it.



Just because you''re outnumbered doesn''t mean you''re wrong.


sharewaregames.20m.com

Share this post


Link to post
Share on other sites
quote:
Original post by -TheDragon

If anyone can shed any information on 1.3 (or 2.0, whichever)




If you read the forums at opengl.org those in the know don''t talk about future releases so microsoft doesn''t steal their ideas as that is how microsoft gets most of their ideas.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
ms love hungarian notation so much that theyve decided to stop using it

>>I''ve been reading about OpenGL quite extensivley latley, and I''ve liked what I''ve been reading. I''ve heard OpenGL 1.3 (or 2.0, as some call it) is either in development or ready for release<<
i havent heard anything about this, though there are another couple of big developments going on with opengl at the moment.
btw would would u like opengl1.3 to contain. personally i cant think of too many things that ild like to add to the 1.2 spec

COM whats this i hear about kde getting into the act arrghh. personally COM is not as bad as some ppl portray it is though ive gotta say it is an idea in practice doesnt really live up to its promise (like so many things )

heres what i use
sound - used to use directsound (dropped it in support for openal)
input - directinput (on windows)
network - hawknl

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
Furby my good fellow,
Take a chill pill, grow a sense of humor and call me in the morning. Dude, I love hungarian notation, but in DirectX they''ve taken things a bit too far with it. I know hungarian notation has nothing to do with COM you dolt. I realize I could make my device object global, but geez, if I made everything gobal that I had to pass around wouldn''t that defeat my OOP? DirectX has some great features, but frankly they''re implimentation blows. I''ll take OpenGL''s lovely global state machine anyday =)
Furthermore, I think you need to take DirectX complaints a little less personally. Everytime someone says anything negative about the API you come out with guns a blazin, it''s nothing personal and we all know that neither API is perfect, just relax a bit my friend! And about me not knowing anything about COM, I love how you can konw everything about me from one post, simply amazing how you do that. DirectX would be much better if they implemented it in more of a state machine style like OpenGL, COM is just getting in the way of a potentially great API.

~S''Greth

Share this post


Link to post
Share on other sites
I find it odd you tell me to:
quote:

grow a sense of humor


and say:
quote:

I love how you can konw everything about me from one post, simply amazing how you do that


You are correct that I did say a few things that I wasn''t entirely sure about, but you are capable of being wrong as well. Simply because you do not understand how something (ie the sense of humour) works doesn''t mean it doesn''t exist or is stupid.

You also seem to have applied this to your other post. When someone says that they like the COM-ness of DirectX, you say:
quote:

Are you on crack?


Which _seems_ to imply (please correct me if I''m wrong) that you think that if someone likes the COM construction of DirectX they must be beyond logical thought and reasoning, and will ''come to their senses'' eventually to prefer the OpenGL way. But I''m afraid it doesn''t work as simply as that. Just because you don''t like something, or don''t understand something does not mean that you would have to be mad or stupid to like it. Please try to understand other people''s viewpoints.

You may respond telling me that you are not like this in general, but this is the behaviour that you have exhibited in your past two posts, and I conclude, not unreasonably, from that that you tend to act like this in general.



Just because you''re outnumbered doesn''t mean you''re wrong.


sharewaregames.20m.com

Share this post


Link to post
Share on other sites
Before this gets ugly, I want to interject a few things to get this back on topic.

First off, I don''t know anything about the status of the next release of OpenGL. And to the best of my knowledge, although there are hardware implementations of OpenGL 1.2 available for Windows from the various vendors, Microsoft has not yet released a generic OpenGL 1.2 implementation, which was supposed to be included with Win2K.

About whether or not DX9 will compare to OpenGL... IMO, DX8 already beats OpenGL in terms of functionality. Ease of use is comparable now as well, especially when you get past doing trivial things.

In the same vein, the market won''t shift in favor of DX with DX9, it''s already shifted. Direct3D (now DirectX Graphics) has been more widely supported and used in PC games for several years now. OpenGL still has a lead in many non-game applications, and DirectX really isn''t in competition there.

Finally, as far as Microsoft stealing ideas from OpenGL:

  • As has been pointed out, they are on the ARB, and have been since the beginning. If the rest of the ARB really thinks they are just stealing ideas, why not oust them?
  • Hello, it''s called "Open"GL for a reason.
  • Why would the DirectX developers have to steal anything? I''ve talked to many members of the DX team, and most of them are brilliant, and very in touch with what people want. They meet regularly with hardware vendors and game developers to see what people want.

Share this post


Link to post
Share on other sites
Furby, while I have enjoyed the personal attacks, I can argue with my officemates if I want to pick a fight on personality, interpret my words as you may....anyway...and now for something completely different...

Myopic Rhino, what makes you think that DX has already surpassed OpenGL in functionality? I''m still in the belief that both API''s are quite equal in functionality. If someone who is an authority on the subject can convince me otherwise I''d be more than willing to stop supporting the API which has lesser functionality, but since they seem to be so ''neck n'' neck'' it just seems logical to me to both learn, code, and support both API''s in a game. If you wouldn''t mind, could you please elaborate on this statement.
-----------------
About whether or not DX9 will compare to OpenGL... IMO, DX8 already beats OpenGL in terms of functionality.
------------------

Thanks,
S''Greth

Share this post


Link to post
Share on other sites
Re: sound with OpenGL... I have used FMOD and now use BASS. From what I''ve heard OpenAL is not that stable on many configurations; but I haven''t tried it.

Share this post


Link to post
Share on other sites
Perhaps stealing is too harsh of a word but delaying the release of the 1.2 until some undetermined time after dx8 is stealing in my book. How long has 1.2 been out for SGI? MS could have released it a long time ago if they wanted to. They have access to all the ideas from other companies on the ARB which they can then implement in a new version of dx. It is sandbagging at its worst. If they don''t believe in OpenGL then they need to get off the ARB. I know ms has all sort of very smart people, I have read a bunch of Hoppes(sp) papers on polygon reduction, but they are not in charge.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
>>I''ve been reading about OpenGL quite extensivley latley, and I''ve liked what I''ve been reading. I''ve heard OpenGL 1.3 (or 2.0, as some call it) is either in development or ready for release<<
i havent heard anything about this, though there are another couple of big developments going on with opengl at the moment.
btw would would u like opengl1.3 to contain. personally i cant think of too many things that ild like to add to the 1.2 spec

COM whats this i hear about kde getting into the act arrghh. personally COM is great though ive gotta say it is an idea that doesnt really live up to its promise.

heres what i use
sound - used to use directsound (dropped it in support for openal)
input - directinput (on windows)
network - hawknl

>>IMO, DX8 already beats OpenGL in terms of functionality.<<

its good that u said IMO but im curious can u name one thing that d3d can do that opengl can''t

>>Ease of use is comparable now as well, especially when you get past doing trivial things.<<

this is purely personal taste



http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
quote:
Original post by zedzeek

its good that u said IMO but im curious can u name one thing that d3d can do that opengl can''t




I can name more than one, but rather than getting into that, let me just refer you to a feature comparison done by someone else: http://www.xmission.com/~legalize/d3d-vs-opengl.html

You''ll see from the list that there are very few things OpenGL can do that DXG cannot, and most of those things are arguably not very useful in games. On the other hand, there are quite a few things that DXG can do that OpenGL can''t that are useful in games.

Btw, I''m personally a big OpenGL fan (I''m coauthoring a book about it, after all), and I still prefer using it over DXG, but OpenGL evolution really needs to accelerate to remain viable.

Share this post


Link to post
Share on other sites
Myopic Rhino, that chart is very misleading. It is only comparing the core features of OpenGL and ignores what I consider one of the biggest strengths of the OpenGL platform - extensions. Every hardware vendor is able to implement their own extensions to the standard to support any other capabilities on their hardware, without having to rely on anyone to approve it.
Currently, when a hardware vendor wishes to add new DX functionality to their hardware, they have to tell MS what they want to do and hope Microsoft eventually integrates it into DX. In the meantime, the functionality is useless even if the hardware exists. This occured with a fair amount of the Radeon''s advanced features. Developers must wait for Microsoft to release a new version of DX before they can use these new features which means they often go unused for a long period of time (look at T&L, Nvidia''s registers, or Radeon''s 3rd texture unit).
On the other hand, using OpenGL extensions, the driver writers can add this additional functionality immediately and developers can start taking advantage of it right away. And if multiple hardware vendors create similar extensions, the ARB standardizes them into an ARB extension so you don''t have to worry about supporting different interfaces for the same features.
So overall, OpenGL with extensions does *everything* DirectX can do and always will, so long as the driver writers wish to support it.

Share this post


Link to post
Share on other sites
ill take one example out of that list (the same applies to the others)
BumpMapping it saiz opengl NO d3d8 YES

now with opengl u can only do bumpmapping on cards that are physically capable of doing bumpmapping eg geforce,radeon,matrox G400 etc.

my card is a vanta(tnt2) which is not capable of doing bumpmapping. it cant do it in either opengl or d3d but yet in the list it saiz d3d YES to bumpmapping.

a truer list would be
card capable of doing bumpmaping
bumpmapping opengl YES d3d YES
card not capable of doing bumpmapping
bumpmapping opengl NO d3d NO

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
Now you''re talking about extensions.

I would suggest the ARB to consider the addition of all the latest extensions in a new OpenGL version (1.3 or 2.0 whatever).

Advanced game programming in OpenGL requires the use of vendor specific extensions, and all the intrinsic benefits of the API are lost managing what hardware you''re running on.
Tha ARB has to rejuvenate the API, IMHO (at last DX8 matches OGL in terms of efficacity, now OGL should borrow some ideas from DX8 in terms of fonctionality).

Share this post


Link to post
Share on other sites
Heh, who cares about bumpmapping anyway ?
I mean, it''s not used anyway since it makes games so slow

I just laugh when you guys say that MS is going to put OpenGL features into D3D ! Just imagine what building and calling a display list will be :


LPDIRECT3DDISPLAYLIST9 lpd3ddl9;
LPDIRECT3DDISPLAYLISTSTATE9 lpd3ddls9;

VOID BuildLists()
{
ZeroMemory(&lpd3ddls9);
lpd3ddls9.dwSize = sizeof(LPDIRECT3DDISPLAYLISTSTRUCT9);
lpd3ddls9.dwFlags = D3DDL_SYSTEM_MEMORY | D3DDL_COMPILE;

lpd3ddl9->Initialize(lpd3ddls9,lpd3dd);
lpd3ddl9->BeginScene();
....
lpd3ddl9->EndScene();
}

VOID CallList()
{
lpd3dd->BeginScene();
lpd3ddl9->CallList();
lpd3dd->EndScene();
}

// End of code !

A couple of questions rise to my mind :
- Will they do it at all ?
- If yes, how will they manage not to make it hilarious ?

Mustard :-P









Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think OpenGL has support for more hardware functions than Direct3D like the simple accumulate buffer in 3dfx cards I can not recall the name of.

True, Direct3D does not limits itself to be an API for the hw like OpenGL so you will find functions for loading X-files, bitmaps and other stuff. If you want similar functions in your OpenGL program do you have to combine OpenGL with some other libraries. Many such libraries exists and can be downloaded from the net.

Perhaps is it easier to have everything in one place but I think the OpenGL community has been enriched by many very talent people and their work. If Direct3D is only a cathedral so is OpenGL a cathedral surrounded by a bazaar.

Share this post


Link to post
Share on other sites
It takes a year or less for a new feature to make it into DirectX. Microsoft releases a new version of DirectX once a year, so the waiting period is insignificant.

Concerning easy of use. I would say that DX8 is just as easy as OpenGL. And D3DX library makes it even better. Now I don''t have to spend time and money on implementing and optimizing quaternions, matrices, etc. Many people trash COM. I think COM is amazing. Look at OpenGL. With every release the API gets more and more bloated. With DirectX there is no need to worry about backwards compatibility, COM takes care of that, so every time new, cleaner interfaces can be designed. DX8 really has an amazing architecture.

When I started working on the 3D engine DX8 wasn''t out yet, so I naturally went with OpenGL because DX7 interfaces simply sucked. If DX8 was out by that time, I''d definetly go with it.

Someone said that OpenGL''s global state machine is better then passing pointers in DX. Better is a very relative term. I don''t like OpenGL''s state machine because it makes it hard to manage OOP design. My engine is completely object oriented, and I would prefer to pass objects then to have a global state machine.

The only issue I have with DX right now are those stupid expandable structures. Since COM takes care of versioning and there are no interface changes between the two releases of DX those structures are practically useless and they make the code dirty, hard to read and hard to write. If the Microsoft team got rid of them and made passing of parameters to functions "normal" I would say that the DX design reached the peak of its evolution.

Share this post


Link to post
Share on other sites

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By LifeArtist
      Good Evening,
      I want to make a 2D game which involves displaying some debug information. Especially for collision, enemy sights and so on ...
      First of I was thinking about all those shapes which I need will need for debugging purposes: circles, rectangles, lines, polygons.
      I am really stucked right now because of the fundamental question:
      Where do I store my vertices positions for each line (object)? Currently I am not using a model matrix because I am using orthographic projection and set the final position within the VBO. That means that if I add a new line I would have to expand the "points" array and re-upload (recall glBufferData) it every time. The other method would be to use a model matrix and a fixed vbo for a line but it would be also messy to exactly create a line from (0,0) to (100,20) calculating the rotation and scale to make it fit.
      If I proceed with option 1 "updating the array each frame" I was thinking of having 4 draw calls every frame for the lines vao, polygons vao and so on. 
      In addition to that I am planning to use some sort of ECS based architecture. So the other question would be:
      Should I treat those debug objects as entities/components?
      For me it would make sense to treat them as entities but that's creates a new issue with the previous array approach because it would have for example a transform and render component. A special render component for debug objects (no texture etc) ... For me the transform component is also just a matrix but how would I then define a line?
      Treating them as components would'nt be a good idea in my eyes because then I would always need an entity. Well entity is just an id !? So maybe its a component?
      Regards,
      LifeArtist
    • By QQemka
      Hello. I am coding a small thingy in my spare time. All i want to achieve is to load a heightmap (as the lowest possible walking terrain), some static meshes (elements of the environment) and a dynamic character (meaning i can move, collide with heightmap/static meshes and hold a varying item in a hand ). Got a bunch of questions, or rather problems i can't find solution to myself. Nearly all are deal with graphics/gpu, not the coding part. My c++ is on high enough level.
      Let's go:
      Heightmap - i obviously want it to be textured, size is hardcoded to 256x256 squares. I can't have one huge texture stretched over entire terrain cause every pixel would be enormous. Thats why i decided to use 2 specified textures. First will be a tileset consisting of 16 square tiles (u v range from 0 to 0.25 for first tile and so on) and second a 256x256 buffer with 0-15 value representing index of the tile from tileset for every heigtmap square. Problem is, how do i blend the edges nicely and make some computationally cheap changes so its not obvious there are only 16 tiles? Is it possible to generate such terrain with some existing program?
      Collisions - i want to use bounding sphere and aabb. But should i store them for a model or entity instance? Meaning i have 20 same trees spawned using the same tree model, but every entity got its own transformation (position, scale etc). Storing collision component per instance grats faster access + is precalculated and transformed (takes additional memory, but who cares?), so i stick with this, right? What should i do if object is dynamically rotated? The aabb is no longer aligned and calculating per vertex min/max everytime object rotates/scales is pretty expensive, right?
      Drawing aabb - problem similar to above (storing aabb data per instance or model). This time in my opinion per model is enough since every instance also does not have own vertex buffer but uses the shared one (so 20 trees share reference to one tree model). So rendering aabb is about taking the model's aabb, transforming with instance matrix and voila. What about aabb vertex buffer (this is more of a cosmetic question, just curious, bumped onto it in time of writing this). Is it better to make it as 8 points and index buffer (12 lines), or only 2 vertices with min/max x/y/z and having the shaders dynamically generate 6 other vertices and draw the box? Or maybe there should be just ONE 1x1x1 cube box template moved/scaled per entity?
      What if one model got a diffuse texture and a normal map, and other has only diffuse? Should i pass some bool flag to shader with that info, or just assume that my game supports only diffuse maps without fancy stuff?
      There were several more but i forgot/solved them at time of writing
      Thanks in advance
    • By RenanRR
      Hi All,
      I'm reading the tutorials from learnOpengl site (nice site) and I'm having a question on the camera (https://learnopengl.com/Getting-started/Camera).
      I always saw the camera being manipulated with the lookat, but in tutorial I saw the camera being changed through the MVP arrays, which do not seem to be camera, but rather the scene that changes:
      Vertex Shader:
      #version 330 core layout (location = 0) in vec3 aPos; layout (location = 1) in vec2 aTexCoord; out vec2 TexCoord; uniform mat4 model; uniform mat4 view; uniform mat4 projection; void main() { gl_Position = projection * view * model * vec4(aPos, 1.0f); TexCoord = vec2(aTexCoord.x, aTexCoord.y); } then, the matrix manipulated:
      ..... glm::mat4 projection = glm::perspective(glm::radians(fov), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); ourShader.setMat4("projection", projection); .... glm::mat4 view = glm::lookAt(cameraPos, cameraPos + cameraFront, cameraUp); ourShader.setMat4("view", view); .... model = glm::rotate(model, glm::radians(angle), glm::vec3(1.0f, 0.3f, 0.5f)); ourShader.setMat4("model", model);  
      So, some doubts:
      - Why use it like that?
      - Is it okay to manipulate the camera that way?
      -in this way, are not the vertex's positions that changes instead of the camera?
      - I need to pass MVP to all shaders of object in my scenes ?
       
      What it seems, is that the camera stands still and the scenery that changes...
      it's right?
       
       
      Thank you
       
    • By dpadam450
      Sampling a floating point texture where the alpha channel holds 4-bytes of packed data into the float. I don't know how to cast the raw memory to treat it as an integer so I can perform bit-shifting operations.

      int rgbValue = int(textureSample.w);//4 bytes of data packed as color
      // algorithm might not be correct and endianness might need switching.
      vec3 extractedData = vec3(  rgbValue & 0xFF000000,  (rgbValue << 8) & 0xFF000000, (rgbValue << 16) & 0xFF000000);
      extractedData /= 255.0f;
    • By Devashish Khandelwal
      While writing a simple renderer using OpenGL, I faced an issue with the glGetUniformLocation function. For some reason, the location is coming to be -1.
      Anyone has any idea .. what should I do?
  • Advertisement