r/GraphicsProgramming • • Jun 13 '24

Undergrad sophomore Graphics Engine

Did this for a class about C++ programming. The world of computer graphics is nothing but amazing!

165 Upvotes

56 comments sorted by

26

u/Rhawk187 Jun 13 '24

Very good job. Most of my seniors couldn't do this from scratch in a semester.

6

u/Due-Issue-6451 Jun 13 '24

That means a lot. I would really like to break into the field, either through industry or academia, and this gives me motivation to push further!

13

u/pizzaisprettyneato Jun 13 '24

I'm a senior engineer in web development and graphics programming still makes my head hurt, even as I've dabbled with openGL

Graphics programming is just a completely different league of difficult every way, and this example that OP has shown is just incredible

7

u/Due-Issue-6451 Jun 13 '24

Thanks a lot. It really means much!

9

u/yamilbknsu Jun 13 '24

I’m getting into OpenGL myself. How do you build the UI around the rendering? (Or what UI system are you using that allows you to integrate a realtime rendering in a DIY fashion?)

I am using GLFW which just creates a window that works but I would like to eventually delve into something like this. I’m doing it for a hobby so no interest in using a real engine like unity, just want to develop something small.

10

u/Due-Issue-6451 Jun 13 '24

Good luck! It's an amazing and rewarding journey.

I used ImGui, which is a fantastic, lightweight and easy to integrate library. It's cross-platform and has bindings for GLFW too.

Now, the trick I do for rendering the viewport, is to create an auxiliary Framebuffer, where I render the final image; and then, I create an Image through GUI and I assign to it the Framebuffer handle.

3

u/yamilbknsu Jun 14 '24

Thanks, I looked it up and it looks cool! I have one question. If I understand correctly, ImGui renders the GUI using the backend (OpenGL) as if it were any other OpenGL graphics? Like, with geometry and shaders?

1

u/Due-Issue-6451 Jun 14 '24

Yup. It produces new geometry each frame that gets rendered like any other type of geometry would.

2

u/meltbox Jul 05 '24

Glad to hear more good things about imgui. Have meant to dabble with it but never got around to it. Also this is quite impressive. People in grad classes do much less than this.

I think if you keep going you will have no problem finding a job with a related portfolio of work like this.

2

u/Due-Issue-6451 Jul 05 '24

ImGui is in a league of it's own. 8)

Thanks for the encouraging words! It would be great to land a job in CG. I have heard there aren't that many CG jobs, but that there is also a huge talent shortage.

I'm now working on a RayTracer with Deep Learning Super Sampling, and hopefully, will be able to post a demo in this subreddit in a couple of months!

6

u/xjrsc Jun 13 '24

How do you even find time? I have a pretty simple rasterizer that I spent about 4 weeks of active work on (like 3-5 hours a day). Simple lighting, shadow maps, textures, GUI to manipulate objects and edit the scene, and so on.

It's coming together and I plan on implementing many more features but I just can't find the time when it's all spent applying for coops, working on other projects, attending class and studying for exams, etc.

Graphics programming doesn't appear to be hireable at the moment too so I'm just so lost on what to do and how to manage my time.

10

u/Due-Issue-6451 Jun 13 '24 edited Jul 29 '24

Well, first of, this is a 4 months project, so there is that.

Also, this was done for a class assignment. That also helped, as I could work on this during the course.

I would be lying if I said it was easy to manage time with everything, but passion really drives you miles! And I hope you can get to finish your engine!

I could be wrong, but I feel that even though graphics programming is not on the spotlight as AI or ML is today, it's still a solid field as there is no many people who know about it and even more importantly, how to implement it correctly and with deep understanding on how it works. Learning computer graphics well requires touching many topics like computer architecture, advanced math, parallel computing and much more, which I believe are valuable skills and very employable, even if not applied to graphics directly.

4

u/xjrsc Jun 13 '24

Thanks for the response.

Passion is the main thing that drives me but when I look at the jobs in my area, 70% of them don't even have c++ on the job description.

I'm thinking of taking my next semester off so I can go all out on graphics programming. Build something cool that I can hopefully post here some day.

Congrats on your work, it's very impressive.

5

u/Due-Issue-6451 Jun 14 '24

That means 30% of them do? That's 1 out of every 3 jobs. That's actually a pretty good number!

There are thousand of technologies out there, and we can't expect every job to ask for the same languages and skillsets. But learning c++ definetively gives you an edge, as it's easier to transition to other languages and it requires a deeper understanding on how computers and memory work, while the opposite is not true (Try going from python to c).

Best of luck, and thanks!

2

u/meltbox Jul 05 '24

Completely agree. The focus has shifted completely from low level and understanding the basic execution pipelines to AI/ML/web. I suspect that in a decade or so the tables will flip with a relatively low supply of engineers who are experienced in those areas.

2

u/Due-Issue-6451 Jul 05 '24

Powerful lord is Mr. Money. Everything that has 'AI' in the title gets too much funding and attention nowadays. With so many 'AI Engineers', it's a matter of time till the bubble bursts, and then it's a game of Supply & Demand.

5

u/Kivtas3 Jun 13 '24

This looks dope. Did u follow any tutorials for this?

10

u/Due-Issue-6451 Jun 13 '24

Thanks!

Yeah, I mostly asked for notes to professors at my school (which were written in a tutorial-like way), but I also used the OpenGL Redbook and LearnOpenGL!

The last two are awesome resources

4

u/letsgetretrdedinhere Jun 14 '24

It would be impressive still even if you didn't put "undergrad sophomore" in the title

3

u/areeighty Jun 13 '24

Fantastic work

1

u/Due-Issue-6451 Jun 13 '24

Appreciate it man

3

u/moreVCAs Jun 14 '24

Diabolical. So sick.

3

u/HaskellHystericMonad Jun 14 '24

You should be using IShellItemImageFactory to construct bitmaps for your asset manager. It's not even 100 lines to get an HBITMAP from SHCreateItemFromParsingName and call GetDIBits on it to get raw pixels (they'll be upside down, DIB is bottom up).

It's a polish detail, but like with multiple clipboard bundles, it's a very significant polish detail that is so trivial of an amount of work that its' omission is glaring. This will also grab the correct images for folders whose icons have been changed through the windows shell, such as network shares with IT specified icons for purpose clarity.

Set your label colors based on dirtiness. You've got what appears to be `reset` buttons on those transform fields but no indication if a field is in its' default or altered state.

Nice job, a considerable amount of work for student.

1

u/Due-Issue-6451 Jun 14 '24

Honestly, I had no idea that was even a thing. I will give it a try as soon as I can. And being able to have custom folder icons seems like a very cool idea!

What do you mean by colors based on dirtiness?
You are right about the reset buttons. Tbh, didn't pay much attention to it, since it was more of a debug utility than anything else.

Thank you!

2

u/waramped Jun 13 '24

Looks awesome. Care to share a feature breakdown?

11

u/Due-Issue-6451 Jun 13 '24 edited Jun 14 '24

Thanks & Sure!

Graphics related: Custom Geometry and Texture loading, Materials, Deferred Shading, Spot Lighting & Shadows, Point Lighting & Shadows, Sun Light & Cascaded Shadow Maps, Bump Mapping, Reflections & Refractions, Skyboxes, Instanced Rendering, Particle Systems, Decals, HDR, Gamma Correction, Bloom and Ambient Occlusion

Architecture related: Space Partitioning, Object Picking & Guizmos, Scene UI and ECS System editor, Content browser with Drag & Drop, Ctrl+Z/Y/C/V, Shader Editor with Hot-Reload, Level Serialization, Particle Editor and Co-editing (you can connect with someone else, and edit the same level with two different computers through LAN)

5

u/prest0G Jun 13 '24

That's incredible, nice job

1

u/Due-Issue-6451 Jun 14 '24

Thank you :)

3

u/Nebulous39 Jun 13 '24

Wow that's insane. I've been working on my engine for years and I don't even have all those features

2

u/Due-Issue-6451 Jun 14 '24

It was a considerable time investment.

Happy cake day!

2

u/meltbox Jul 05 '24

Honestly this would have been impressive without ANY of the architecture features implemented. This is really good for 4 months. I mean its really good for a year to be honest haha.

2

u/Due-Issue-6451 Jul 05 '24

TBH, it would have gotten out of hand without some of the architectural features 😅 in terms of performance & extendability

Thanks a lot man! Your kind words mean a lot!

2

u/Effective_Hope_3071 Jun 13 '24

As an assignment!? 

5

u/Due-Issue-6451 Jun 13 '24

Kind of but not really, it was the 'final project' of a subject. We were required to do something in C++ with no restrictions as long as we implemented some minimal requirements.

3

u/Effective_Hope_3071 Jun 14 '24

Impressive. My "final project" was managing two threads in a dead simple program lol. 

2

u/Due-Issue-6451 Jun 14 '24

Thanks :) I really wanted to make the most of it

2

u/Effective_Hope_3071 Jun 14 '24

Any plan to open source it and invite collaborators?

1

u/Due-Issue-6451 Jun 14 '24

The repository is public, but I didn't prepare it nor the code to welcome external collaborators, as it was conceived as a "toy" project.

However, if people are interested, I would welcome the idea with open arms!

https://github.com/sejja/Advanced-Graphics

2

u/_d0s_ Jun 14 '24

that's a super cool project. reminds me of our own real-time rendering project we did at uni nearly 10 years ago! we also rendered the crytek sponza scene :D https://www.youtube.com/watch?v=0qVAnwsJY2w

2

u/Due-Issue-6451 Jun 14 '24

That looks really cool! The skeletal animation and the camera splines look crazy smooth too

Is that from TU Wien?? The course is crazy famous and the content is great!

2

u/_d0s_ Jun 14 '24

Yes! That was during my master's at TU Wien. I didn't know the course was famous :D How do you know about the course?

There is a ton more examples of student projects done for the course, if anyone wants to take a look: https://www.cg.tuwien.ac.at/courses/Realtime/HallOfFame/

2

u/Due-Issue-6451 Jun 14 '24

It's known to be the best Computer Graphics course in Europe! (allegedly)

Some of the demos are so cool though...

2

u/saccharineboi Jun 14 '24

This is super cool. I especially like the fact that UI is clear and intuitive.

1

u/Due-Issue-6451 Jun 14 '24

ImGui, it's just so easy to use. Thanks!

2

u/saccharineboi Jun 14 '24

This makes me wonder whether ImGui is usable for general purpose UI. I know it's for tools and engines, but then how difficult can it be to implement high-level components like dropboxes and etc?

2

u/meltbox Jul 05 '24

You can, the issue is you don't get the 'look and feel'

A lot of people avoid these because they don't have the win32 or metro or whatever the hell kind of abomination Microsoft is cooking up nowadays - feel. QT has a bit o this same issue.

2

u/Due-Issue-6451 Jul 05 '24

Doesn't look Java enough

1

u/Due-Issue-6451 Jun 14 '24 edited Jul 05 '24

Actually, you can program general purpose completely fine with it! The only drawback is it's immediate mode design, which may produce some overhead, but it's quite a small price to pay for such an amazing tool! I believe there are many actual apps that use ImGui as UI library.

In the engine, dropboxes (assets can be drag&dropped) were implemented with 20 lines of code or less.

2

u/[deleted] Jun 15 '24

i also wantt to make my engine (i am an undergrad) but i just want to learn so many things that i always get distracted like right now i am studying about CPU architectture

1

u/Due-Issue-6451 Jul 05 '24

Try to implement a basic rasterizer in OpenGL. You will feel satisfied, and then it's downhill from there.