As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need to know why OpenGL doesn't have circle or curve functions, unlike the rectangle and polygon built in functions.
Because GPUs don't generally have hardware-accelerated notions of those shapes for real-time rendering. Graphics hardware is designed around a pipeline for rendering triangles, which are the primitive graphics geometry (and by extension can usually create the trivial additions of quads and etc). Any other shapes (curves, generalized meshes, etc) are up to you to create and turn into things that the GPU can render.
As a result, "allowing" you to build e.g. circles yourself allows you to control how complex the geometry gets. You wouldn't want GL to decide for you how much stuff to generate when you need a "circle"-- it will depend on what you're doing, how much detail/smoothness you need, etc.
Since it's no fun to keep reinventing the wheel (har), there are lots of higher-level graphics libraries that you might end up using that can easily create those geometries for you. But they operate on top of pure GL.
I think at earliest days of computer graphics acceleration, the accelerator horsepower was a tad weak, so anything non-linear were considered costly. Curves happened to be non-linear in most cases.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I wanted to know how badly my games will be affected by using glBegin and whatnot instead of GLSL and VBOs and VAOs and all that. They just look so difficult and ridiculous to achieve what I can do easier. What will the effect of my choices be?
Badly.
The direct mode API with glBegin() and glEnd() is deprecated, largely for performance reasons. It doesn’t really support data parallelism, and relies heavily on the CPU—requiring at least one function call per vertex. That adds up quickly.
The direct mode API might be simpler and more pleasant for you to use in small projects, but using VBOs scales better, both in terms of performance and maintainability. It’s much easier to manage data than it is to manage state.
Also, learning the new API means you’re up to date on how OpenGL is and should be used in the real world. If you’re looking to work in the games industry, for example, that’s just plain useful knowledge.
Some useful learning materials:
An Intro to Modern OpenGL
Learning Modern 3D Graphics Programming
OpenGL Tutorials for OpenGL ≥3.3
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need a recommendation for a good learning resource on drawing algorithms. I've found plenty of books on algorithms but it is mostly vector and matrix linear algebra, which does not cover the topics I am interest in:
efficient drawing of primitives and curves
efficient filling of primitives and paths
multi-sampling or similar techniques for smooth painting
sub-pixel painting
linear, radial, conical and other types of gradients
etc...
I am not interested in a book on some API that has those implemented like Cairo, GDI, Qt or similar, but the implementation details themselves. I am not particular interested in big and complex math formulas, I prefer a more visual, intuitive approach with example code, pseudo code also works fine.
Also, before anyone rushing to close the question - I did bother to search for something like that. Thanks in advance!
I can usually find what I need in this book
"Computer Graphics: Principles and Practice in C" by James D. Foley, Andries van Dam, Steven K. Feiner, John F. Hughes
I can recommend two books:
Tricks of the Windows Game Programming Gurus - more on 2D graphics
Tricks of the 3D Game Programming Gurus-Advanced 3D Graphics and Rasterization - more on 3D
and of course "Computer Graphics: Principles and Practice in C"... as mentioned in previous answers
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I would like to develop a small cross-platform for (structured) mesh generation software (similar to Gmesh) and possibly 3D pre/post processing (like Salome).
In order to make things easier I'd like to use already made libraries, to better focus on the development of what I need.
I need
1. geometrical modelling capabilities
2. GUI
3. 3D visualization.
I have been looking around but the whole workflow results a bit blurry.
I think pyGTK and GLADE are good choices for me ( because of the community and the very open license with respect to pyQt).
The modelling part could be handled by Open Cascade ( preferably pythonOCC) but for the visulization in a pyGTK widget I don't know what to do.
I was thinking to use openGL (PyGtkGLExt) but I understood that OpenGL is too low-level.
FreeCAD (http://goo.gl/V4FCW) uses Coin3D (I could use pyvy maybe) for this reason but a software like Gmesh uses directly OpenGL.
On top of that I saw that for scientific visualization, VTK would be probably better, but I don't understand whether it is based on OpenGL or not. In my opinion OpenGL is nice because it is supported by graphic card drivers making the whole software faster.
I should be able to render geometries built by pythonOCC into a pyGTK widget but what kind of libraries would be better to use? OpenGL alone (maybe to complex to program?)
Coin3D (or similar) to speed up the use of OpenGL?
VTK alone? VTK in combination with OpenGL?
Other combination and/or libraries?
Have you experience in this kind of software?
Do you have suggestion about it? Do you know tutorials where the combined used of these libraries is explained?
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to build a little software rendering library, because I like the idea of voxels, and the possible other alternative methods of rendering. Call me naive.
Using vanilla c++, with codeblocks, on a win7 system but with cross-platform intent. Using glfw for window management.
My plan is to use the gpgpu for opencl (parallel) calcs, then using OpenGL (in 2D view) for cross-platform context management and frame display.
Thus using the gpgpu for accelerated calcs, but leaving it up to me to define what those calcs are for. And asking OpenGL to just draw my results on screen.
Is there any easier cross platform way of putting my own renderings to screen?
Is this proposed method awesome, or not?
glfw3, which is under development has access to native opengl contexts. you can use that to create an interop opengl context. I haven't tried it yet myself though.
Is there any easier way?
Maybe, but none that I'm aware of.
OpenCL supports OpenGL interop, which makes what you're trying to do very fast.
(i've used it myself, and it was fast, but maybe not as fast as I would have liked, but I used it in a inefficient way)
Is this awesome? Maybe, but remember that opencl can't use all the hardware that opengl can, so if possible, use opengl for graphics.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am learning Computer Graphics at the university and I'm trying to figure out the use of it ... and I fail.
Only games and movies stick in to my mind, I'm sure there are other uses for, let's say, graphic algorithms, openGL, 2D and 3D, 3ds Max ...
Is it useful later on ? Where do I need it ?
Thank you
Medical and scientific visualization, simulations, preservation of cultural heritage come to mind.
First of all there is of course 3D:
CAD (did you know that today all cars, planes, boats or actually anything is designed via a computer and a CAD software?)
Scientific visualization, terrain visualization (think of google-earth), scientific simulations (any kinds of simulations actually, from fluids to sounds, or deformations, molecules, and so on...), medical visualization and assistance during surgery, etc...
User interfaces (not only 3D on the screen but also new input devices need to be designed)
...
And of course 2D is part of Computer Graphics. Think of digital photography, image filter algorithms, real-time encoding and decoding of highly compressed video, digital cameras chips, etc... List is endless.
How about the 3d CAD software that engineers and architects use?
In addition to what the others have said think about simulators. Flights probably have to be simulated these days in order to avoid crashes. While it can be done without any representaton people will need to see the output in the form of some visual representation and thus you need graphics.
Even this website has graphics on it. Depending on the browser it might not be hardware accelerated but it is a graphcs context.
Even console based applications provide you with text that is represented visually and that's because human eyes are the easiest way of offering output.