Jump to content
  • Advertisement
Sign in to follow this  
lazy_hack

OpenGL How to get high quality graphics in openGL?

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

Hi, I have been learning openGL for 2 months now. I have seen a lot of samples from redbook and Nehe tutorials and written some of my own. But still I don't get the game style high quality graphics. The graphic quality looks very childish. Should I use some shaders ( I have heard about GLSL)or some other library also?

Share this post


Link to post
Share on other sites
Advertisement
Shaders are essential for any modern realistic graphics application. A big step using shaders is per-pixel lighting, computed in the fragment shader. Many more advanced and popular techniques, such as parallax mapping, correct HDR and bloom build upon the basic shader techniques.

GLSL is a fine choice for shaders, since it is present in the core of OpenGL as from version 3.0 and thus requires no added libraries. It is at least the easiest choice to get started.

HLSL is DirectX's GLSL counterpart. It is not usable in OpenGL.

CG works with both OpenGL and HLSL, but requires the CG library. Some would defend writing shaders using CG, since they are easily portable to DirectX. Shaders look very much alike however and porting them is easy regardless. Note that OpenGL also runs on Windows, so in a way you shouldn't need a DirectX port at all.

Share this post


Link to post
Share on other sites
It's also important to understand that to achieve "realistic" graphics, it's not just down to shaders, shaders play a part but you also need high quality art such as models and texture work, good level of detail and culling methods to allow you to push your artworks polygon count, texture sizes and number of texture stages. Also things you may want to do outside of shaders to precompute certain effects (pre-computed radiosity transfer and the like) can be taken into account. Obviously all of this needs to be highly optimised to allow you to accumulate all the various layers and effects to create "realistic" looking scenes running at interactive framerates.

It is my opinion that good artwork and average tech in an engine can look a lot better than the best tech imaginable and shoddy artwork... so dont put it all down to just the shaders but yes shaders are a good step :)

Share this post


Link to post
Share on other sites
Thanks for the help. Now how to go about it? I don't want to design games. Most of the tutorials on web are for game programming. I want to add some graphics for image viewer applications. Where should I look?

Share this post


Link to post
Share on other sites
Quote:
Original post by Ignifex
GLSL is a fine choice for shaders, since it is present in the core of OpenGL as from version 3.0 and thus requires no added libraries. It is at least the easiest choice to get started.


bzzzzz wrong.
GLSL became core since GL 2.0

Share this post


Link to post
Share on other sites
Quote:
Original post by Ignifex
Very true. Whatever an engine tries to draw will only look as good as the art it uses. :)

Although that's obviously true, lighting and shadowing are also tremendously important. It's surprising how much of the visual processing in our brain is dependent on correct lighting. Physically implausible lighting is the prime reason for that 'unrealistic CGI feel' a lot of rendered images show.

In fact, even a simple uni-coloured box can look photorealistic if the right lighting system (global illumination) and the right physically modeled surface representation (BRDF) is used. A good GI system can actually make up for crappy art in a way. It will still look bad, but bad in a photorealistic way :)

Share this post


Link to post
Share on other sites
Quote:

CG works with both OpenGL and HLSL, but requires the CG library. Some would defend writing shaders using CG, since they are easily portable to DirectX. Shaders look very much alike however and porting them is easy regardless. Note that OpenGL also runs on Windows, so in a way you shouldn't need a DirectX port at all.

Cg also has the added feature of offline-compilation. Other languages like HLSL and GLSL require the programmer to keep the shader source around and compile it at runtime, but Cg can be compiled beforehand and the binary shader executable just loaded right in at runtime.
Perhaps this is a selling point for developers who wish to obfuscate their source in the end-product, or wish to optimize the load times as much as humanly possible.

Share this post


Link to post
Share on other sites
For lighting check this paper out:

http://www.valvesoftware.com/publications/2007/NPAR07_IllustrativeRenderingInTeamFortress2.pdf

It's NPR rendering but should give you an idea as to what can be achieved through well-implemented lighting.

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
Quote:
Original post by Ignifex
GLSL is a fine choice for shaders, since it is present in the core of OpenGL as from version 3.0 and thus requires no added libraries. It is at least the easiest choice to get started.


bzzzzz wrong.
GLSL became core since GL 2.0

Aw damnit, that's why I don't like trying to post facts. The risks involved...
Quote:
Original post by Yann L
Although that's obviously true, lighting and shadowing are also tremendously important. It's surprising how much of the visual processing in our brain is dependent on correct lighting. Physically implausible lighting is the prime reason for that 'unrealistic CGI feel' a lot of rendered images show.

In fact, even a simple uni-coloured box can look photorealistic if the right lighting system (global illumination) and the right physically modeled surface representation (BRDF) is used. A good GI system can actually make up for crappy art in a way. It will still look bad, but bad in a photorealistic way :)

Often enough, graphics programmers overlook the importance of a realistic and artistically correct scene to show off their rendering techniques. I'm sure you're also familiar with the engines showing parallax mapping on a brick wall, where the texturemapping is done so poorly that the seams between the faces ruin the realism of the effect. And for most scenes, the BRDF and lighting parameters are also determined by the artist.

I agree with you though. :) But don't overlook the importance of a cleverly sculpted model or proper material settings, especially for real time applications.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!