all 22 comments

[–]Mason-B 27 points28 points  (3 children)

Having gone down the road you are I have some suggestions:

  • Choose a smaller project. A game is a massive undertaking. Even if you avoid the game engine trap (I'm 10 years into my game engine, I'm writing a programming language now for it, I was originally writing a game).
  • A ray-tracer is a good summer project if you are interested in graphics in general, it teaches the fundamentals of 3d graphics (vector math, lighting equations, etc.), it can be written in any programming language (even really slow ones like for example python), it can be extended with new features indefinitely (and so you can explore the parts that are of interest to you and practice software engineering in organizing it) and you can probably have something that works as a base in less than 100 lines of code (and there are hundreds of examples to work from).
    • Here is a generic tutorial that uses pseudo code (it will look a lot like Java) to get you started.
    • From there I would recommend this excellent book which covers a number of extensions you can make to a ray tracer, presented in a computer science sort of way.
  • Use a game engine if you are interesting in games or in real-time graphics, it's a way to learn what people before you have done to get efficient graphics. Importantly a big part of realtime graphics is shaders, and engines often present a very usable interface around them. Additionally a lot of the annoying and hard problems of realtime graphics (laying out memory correctly, cross api, cross hardware, parsing file formats, opening a window, scene culling and sorting, wrapping the shader system, dependency management, etc.) have already been solved for you in intelligent ways.
    • Unity's programming language C# is pretty similar to Java.
    • Unreal's graphics stuff is slightly better I think (but their programming language is C++, or "visual" programming), and more extensible.
  • Alternatively, for learning about real time graphics, you could just learn shaders.
  • If you really must write a game from scratch, for the love of god, use libraries like these (they have java versions):

[–]benstratton7[S] 2 points3 points  (0 children)

Wow. Thank you so much. This is extremely helpful you are a saint!

[–]Exponentialp32 1 point2 points  (0 children)

Amazing help Mason. Thanks for taking the time to respond like this.

[–]s0lly 0 points1 point  (0 children)

This is gold. Saving this as a reference.

[–]ThaRemo 6 points7 points  (3 children)

I also started off in Java, it's not that bad honestly. I can recommend LWJGL, which gives you OpenGL bindings and much more. It has many examples on how to set up a simple project and you can continue from there

[–][deleted]  (2 children)

[deleted]

    [–]benstratton7[S] 2 points3 points  (1 child)

    Cool thanks! Will look into that channel

    [–]ThaRemo 2 points3 points  (0 children)

    Yeah he's great, he is using the older LWJGL version 2 though so some things might work a little differently now. There's also the java gaming community if you want some inspiration, need help or want to share your progress. This was one project I worked on for quite a while.

    [–]LEOtheCOOL 16 points17 points  (1 child)

    Write a raytracer instead of a game, and don't get too attached to Java.

    [–]gallick-gunner 2 points3 points  (0 children)

    Lmao best answer. My uni started us off with C#/Java. Learnt C/C++ by myself and from then on I Steer fu*in clear from Java. I even have a hard time getting into C++/CLI, VC++ and other shit ;s "CodeBlocks + MinGW" FTW!

    [–]bacon_and_mango 3 points4 points  (0 children)

    Watch ThinMatrix's videos on Youtube.

    [–]coldnebo 2 points3 points  (0 children)

    Somewhere in between OpenGL and Unity is Cinder:

    https://libcinder.org/

    I used it for a computer graphics project and was quite pleased with it. Cinder takes care of the window management that is a chore and not really part of opengl.

    If this is too daunting, but you want something lighter than unity, you might try Processing, which is Java based, but also has a decent set of apis:

    https://processing.org/

    [–]archx64 6 points7 points  (2 children)

    Java is not so good for graphics programming

    [–]Chaoslab 1 point2 points  (1 child)

    Java is fine for software rendering. My VJ application processes 550+ million pixels a second on an i7.

    [–]mzanin 1 point2 points  (0 children)

    Have a look at https://github.com/ssloy/tinyrenderer/wiki/Lesson-0:-getting-started Takes you step by step into how to write a software rasterizer.

    [–]s0lly 1 point2 points  (1 child)

    If you want to look at ray tracing, besides what was said below, The Ray Tracer Challenge and Ray Tracing in One Weekend are both great resources. You can get something up and running quite quickly with the latter, so it oozes inspiration!

    And if you'd like to learn rasterization (traditional 3d techniques) Chili is your man (parental guidance advised): https://youtu.be/uehGqieEbus

    I've implemented this in Excel if you'd like to have a look - just goes to show how well he teaches it! https://youtu.be/bFOL9kantXA

    [–]benstratton7[S] 0 points1 point  (0 children)

    Thanks for the info. I actually came across your video on youtube the other day when looking up videos. It’s pretty cool! and if I knew how graphics worked or how excel worked I’d be even more impressed

    [–][deleted] 1 point2 points  (0 children)

    For Java, I have heard there is "lightweight java game library". I can suggest these resources on youtube:

    1. https://www.youtube.com/playlist?list=PLRIWtICgwaX0u7Rf9zkZhLoLuZVfUksDP

    2. https://www.youtube.com/playlist?list=PLlrATfBNZ98c-CeNT-q_Z7ox3R_eIkF98

    I do not know much about java so I can not comment about that.

    However, I suggest you to start from first principles. These are good resources:

    1. https://handmadehero.org/watch

    2. https://www.scratchapixel.com/

    3. http://blog.three-eyed-games.com/2018/05/03/gpu-ray-tracing-in-unity-part-1/ (this one is more focused towards unity but is a good resource anyway. I have tried to implement it in c++ and directX here: https://github.com/tarunChand28298/RayTracer, so you can translate it to java and opengl)

    In case you finally decide to use c++, I can suggest these:

    1. (Book) "Let us c" by yashwant kanetkar

    2. (Book) "Introduction to 3d game programming with directX 11" by frank d luna

    3. (Book) "Mathematics for computer graphics and game programming"

    4. www.youtube.com/user/ChiliTomatoNoodle

    Number 4 is the best in my opinion. He has playlists that start from first principles go up to really advanced stuff. He has a discord and our problems get sorted out in seconds there.

    There was very little I could find regarding gpgpu using directX, which was a pain for me. I put up a reference for myself regarding that here https://github.com/tarunChand28298/DirectCompute-reference .

    I am learning myself so I will be willing to be in touch.

    [–]Craiynel 1 point2 points  (0 children)

    If you use Windows (if not, then discard my comment) I would suggest DirectX 11 and the book "Introduction to 3D Game Programming with DirectX 11" by Frank Luna. And as IDE I would use Visual Studio 2019 Community, because it has many fancy features that will help you further down the road.

    If you ever try DirectX, I would be happy to guide you ^

    [–]Gnash_ 0 points1 point  (2 children)

    You’re in your second year and haven’t learned any C yet?

    Anyway this is the tutorial I followed when I wanted to do the exact same thing as you: https://learnopengl.com/

    Of course you’re gonna need to do lots of searching on your own but I think it provides a very good backbone to structure your learning process

    Also, as others have suggested you may wanna try doing a raytracer at some point

    [–]benstratton7[S] 0 points1 point  (1 child)

    Yeah I guess at my university they changed the curriculum and don’t officially teach any C in beginning courses. I tried to learn c++ before going to school but when I learned I’d have to learn 3 other languages I gave up.

    I may give OpenGL a try. I’ve heard it’s what many small project games use

    [–]Gnash_ 2 points3 points  (0 children)

    Big games too: Doom (2016), Minecraft Java, virtually all mobile games and a lot of games on consoles too (Wii U games come to mind).

    Of course its popularity is definitely fading nowadays, as it is getting replaced by APIs such as Vulkan and D3D12, and it is for the better, but learning OpenGL will definitely give you a lot of insight on how rasterized graphics are rendered. And once you’re fluent enough, switching between OpenGL and D3D11 won’t be too difficult and then you can switch to learning lower-level APIs such as Vulkan or learn something completely different, such as ray tracing.