Sign in to follow this  
3Ddreamer

Is OpenGL or Java Great for Real Time Object Shadows?

Recommended Posts

3Ddreamer    3826

Hi,

 

 

I want to incite a debate, which is why I started this thread here.

 

So, does Java or OpenGL get a "bad rap" in the real time rendering of shadows or is this not right, especially in regard to any performance hit imagined by the coders who try real time, nice shadow rendering while using them?

 

I am suspicious and believe that there surely must be a way to render real time shadows with excellent performance using Java and/or OpenGL coding. What is the strategy to get that great performance of shadows?

 

 

 

Clinton

Share this post


Link to post
Share on other sites
3Ddreamer    3826

I hear or read both Java and OpenGL getting criticized for a performance hit in using them (together or exclusively) for real time shadows.  Is this justified?

 

 

Clinton

Share this post


Link to post
Share on other sites
Six222    453

What TheChubu is saying is that Java doesn't have much to do with OpenGL, Java can be used to make OpenGL calls. OpenGL is used in many high quality/performance applications so I wouldn't worry about it.

 

You are right about Java, it isn't as fast as others (C++ etc.) but it will be more than enough to support what you will want to do.

Edited by Six222

Share this post


Link to post
Share on other sites
vipar    171

Not entirely true.

 

It seems to be a common misconception that Java is a slow language when in truth it's not really slow compared to so many other languages. A poorly made C++ program can perform many times worse than a decent Java program.

 

Games like Runescape by Jagex was made in Java and is now transitioning into HTML5 after many years of running in Java. That is a very successful, casual, MMORPG in your browser. And that game worked pretty much perfectly.

Sure, if you want to work real magic with graphics, processing and so on, C++ is what you need as it gives you much power and control. But the bias against Java is a bit old now.

 

OpenGL is just an open standard for graphic applications. It works as interface to provide OpenGL Bindings between the hardware and your application. It is not bound to one single language. You can look at a framework like SFML which got Java bindings. Combined with the Artemis Framework (Component Framework for games) you can make excellent games in Java too.

Edited by vipar

Share this post


Link to post
Share on other sites
3Ddreamer    3826

Long term, I am going to use Java and OpenGL.

 

I specifically want to get at what seems to me is a myth about a significant performance hit when implementing real time shadows in Java or OpenGL.  Most of the other issues I probably already know.

 

 

Clinton

Share this post


Link to post
Share on other sites
SimonForsman    7642

I hear or read both Java and OpenGL getting criticized for a performance hit in using them (together or exclusively) for real time shadows.  Is this justified?

 

 

Clinton

 

No,

 

OpenGL gives you roughly the same performance as Direct3D10/11 on nvidia and AMD GPUs (Intel is a different matter, their OpenGL drivers on Windows have been fairly poor in the past and might still be poor(i havn't bothered testing them in the last couple of years) and sometimes significantly better performance than D3D9 (primarily due to a lower drawcall overhead).

 

Java adds a bit of overhead on OpenGL calls though since you have to go through the native interface to access a native library but it shouldn't be enough to cause problems unless you are making insane amounts of native calls or if you're allready pushing the limits of the hardware.

 

If you get performance issues with Java it is far more likely that it is memory related (It is quite difficult to write cache and garbage collector friendly code in Java), for well written code however Java can perform just as well and sometimes even better than C++.

 

There are basically three areas where Java really falls short of C++ performance wise.

 

1) Control over memory (This makes some cache related issues difficult to solve and cache misses are very expensive, + the GC can be a pain in the ass, C++ provides better tools such as custom allocators, placement new, etc to deal with these issues in a reasonably sane way)

2) Native call overhead (For a game its not just rendering that may require native calls, you might also need it for sound and physics for example and while the overhead isn't that big it does add up)

3) No manual SIMD support. (manual SIMD support is missing in C++ as well but most modern C++ compilers provide extensions for it on the platforms that can use such instructions making it less of an issue, for 3D games there is often quite alot of code that benefits greatly from using SIMD)

Share this post


Link to post
Share on other sites

One of the first things I really tried to understand as I introduced myself to programming, was the whole methodology aspect of it and how you approach a given problem. After all, if you're gonna spend a lot of time doing top down programming, you better learn how to generally solve problems that way too. This isn't just something a programmer does, but anyone problemsolver.

 

As I understand it, the programming language you use is rarely, if ever, a major factor as to why things don't work properly. Language has more to do with ease of use and the overall range of what you can do (and not how well you can do them).

Edited by Malabyte

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this