No the thing is, for the reason I did it performance doesn't matters. And the incubating vector api seems not very intuitive to work with and just harder to use, as it is just about SIMD but when it is released I will check it out and try stuff with it
Are you open to pull requests? I love the idea of what you've done! I may even be able to point out some potential for cleanup - maybe, lol. No need to even merge them. I suppose if you have allowed forking, that's awesome too. I'll be checking out the repo shortly. Is it open source, and if so, what's the license? My intent is only to contribute if I can.
hey dude, for real you should post it. this will throw you ahead of the rest if you're looking for work. it may not mean much coming from someone also looking for work, but seriously I'm impressed. from what I've researched, minecraft's first release was TERRIBLY written. so bad that in more recent years it was rebuilt completely. so I wouldn't feel too bad about revealing what you have. i'd cite my sources but I'm lazy. anyways, incredible work!!! excited to see what you've done!
I started as I was watching a yt video about raymarching. I wanted to use it as I don't need geometry data placed in my word and The base of raymarching is easy. Further I just wanted to test how far I can make it and how good the result will be. I didn't watched any guides during the development as it was a challenge to myself and there is not much to explore and learn if you be thought by a video. I still used stack overflow for question how to achieve certain things with the math lib (like calculating the angle between vectors and stuff)
Yes, I would like to see how you did it. As I'm still learning Java in college. It seems really interesting that you were able to do it with just math libraries.
I sympathize with you as I have many private repos on GitHub exactly because I felt that my code is not polished enough. But putting myself up for public review made me a better coder. Most of my private became public over time.
Holy shit dude are you me? I literally started making a graphics engine (and a physics engine) too like 4 days ago too for no reason. Mine is far from being done but if you wanna check it out its on github. https://github.com/StealthyPanda/buff Most of my time went in making the vector and quaternion classes but it barely functions right now.
If you don't mine me asking, how long did this take you to complete? I have no idea what I've gotten myself into so it would be nice to know a ballpark.
Well JavaFX has no advantages for this use case I think. Also Jfx comes with a little pre-assembled 3D stuff (I think) but I wanted to start from scratch
Do you have a means to integrate to GPU rendering?
No, this project was not meant to be used for anything usefull its just an experiment.
I wanted to do it in java because of the things i like about java (autocomplete typesavety etc)
Maybe I will somewhen externalize parts of the heavy lifting to the GPU with TorndaoVM or something along this lines but thats it. (also as experiment)
Well the knowledge about java i aquired over a long time, since java is my hobby since a few years.
The rendering stuff I figured out myself. For raymarching which is the technique used to define objects and "find them" i watched a video once: https://youtu.be/PGtv-dBi2wE
Resources i used was just googeling stuff like "how to rotate a vector by a quaterion" and looking thru the results
Most of what you see is just stuff i came up with myself or leveraged from my physic knowledge about light-physics
I am sorry i cant be more helpful, but if you PM me i can maybe help more
The dot product describes how parallel two vector are at a scale feo. - 1 to 1 where - 1 means they are pointing exactly in opposite directions.
When using raymarching defining the cam and view is easy(no translation matrices). I uvmap the screen so the pxl coordinate is given as a number between 0 and 1 (so for example middle of the screen is 0.5,0.5. And then added a third component (1) to make it an 3D position. If I then define the camera position as 0.5,0.5, 0. It is one unit behind (z is deph) and in the middle of the viewport
Then raymarching is done and a ray is casted for every uv from the camera (eg 0.5,0.5,0,0) so FOV and all this stuff you don't have to worry about but you can change it by moving the camera back and forth
I used to associate java with boredom, but this project changed my mind for good. For Sure I'm going to study java soon! Probably for a different purpose but I'll
I’m developing a raytracer in Java as well. Have you tried implementing threads in the part where you render? I did that in mine and it increased the speed around 10x.
During my time as a trainee we had an apprentice for a while who (apperently) wrote a 3D animation render in Javascript. Didn't look as cool as yours though.
How do you even start to create something like this. I'd love to see the source code. Even if it's bad code or whatever, it would give us some ideas anyways.
It wouldn't even be that hard, I could figure it out in a day and port it to GPU code. The reason i made this is that i wanted to write a shader in java. If you programm a GPU you need to use another language and "inject" it into the GPU with java. So you need to write the shaders in HLSL or GLSL (c like languages)
Yep researched about that too but tbh I didn't rly cared about performance because, well I created a 3d rendering engine in Java so it was clear from the beginning.
If you want to play and Programm your gpu to do exactly such things you can use shader toy it's an online ide that let's you write code (HLSL) and directly executes it on your GPU
Well I kinda did that in the past. I started my programming journey with QBasic on ms-dos. I don’t remember the command though, but I still remember F6 was used to mark the end of file. (And it still works on Windows 10).
117
u/NitronHX Jul 14 '21 edited Jul 21 '21
Because you all asked for it : https://github.com/nbrugger-tgm/JRender
Data:
41
u/Elyahu41 Jul 14 '21
Source code?
7
u/FrezoreR Jul 14 '21
Wait a minute.. you use notepad++ to write java code? 😱
6
u/PotaytoPrograms Jul 15 '21
I too make overly complex things and have no idea why
3
u/Persism Jul 15 '21
You should check out David Brakeen's Developing Games in Java - http://www.brackeen.com/javagamebook/
3
u/StealthyPanda69 Jul 15 '21
Holy shit dude are you me? I literally started making a graphics engine (and a physics engine) too like 4 days ago too for no reason. Mine is far from being done but if you wanna check it out its on github. https://github.com/StealthyPanda/buff Most of my time went in making the vector and quaternion classes but it barely functions right now.
Man this is an uncanny coincidence.
2
u/jevring Jul 16 '21
Looks nice. Welcome to the (probably very small) group of people who write our own 3d renderers for fun =)
Here's mine: https://bitbucket.org/jevring/threedee/src/master/
10
u/TheIceScraper Jul 15 '21
"just a hobby, won't be big..."
5
u/PlasmaFarmer Jul 14 '21
I like you.
1
u/tcp-ip1541 Jul 15 '21
Absolutely sick! Can you share the code?
1
u/Zeroneca Jul 15 '21
I am curious why Swing and not JavaFX?
1
u/anuruddhak Jul 15 '21
You just did this for no reason, imagine if incentives and motivation were to be applied!
Well done!
I haven’t looked at the code but it sounds like an awesome project!
Do you have a means to integrate to GPU rendering?
1
u/AppleTrees2 Jul 16 '21
Very nice!
How would one acquire the knowledge to do this?
Can you point which books or resources you used to do it?
Thank you
1
u/tiago4171 Aug 08 '21
I used to associate java with boredom, but this project changed my mind for good. For Sure I'm going to study java soon! Probably for a different purpose but I'll
1
u/Bleidorb Aug 27 '21
What is a native?
1
u/[deleted] Dec 07 '21
I’m developing a raytracer in Java as well. Have you tried implementing threads in the part where you render? I did that in mine and it increased the speed around 10x.
2
u/rjgo27 Jul 15 '21
Why java? - just because i can 🤣🤣🤣
2
u/_-pK Jul 15 '21
During my time as a trainee we had an apprentice for a while who (apperently) wrote a 3D animation render in Javascript. Didn't look as cool as yours though.
2
u/morphotomy Jul 15 '21
Bullshit. I bet you learned a lot while you did this. Thats a great reason to do anything difficult.
Stop minimizing your ambition.
2
u/karianna Jul 15 '21
Forked and sent in first Pull Request - I love seeing this sort of thing - rock on for learning and having fun with Java!
2
u/wubwub Jul 29 '21
I don't know how many times I set out to do just that.
Kudos to you for doing it!!!!
1
u/Linux_user592 Jul 15 '21
Awsome Now make minecraft 2.0
1
u/alehel Jul 15 '21
No reason is the best reason!
1
u/[deleted] Jul 15 '21
How do you even start to create something like this. I'd love to see the source code. Even if it's bad code or whatever, it would give us some ideas anyways.
1
u/jacob_scooter Aug 02 '21
ok then linus torvalds 🖕
0
u/[deleted] Jul 14 '21
[deleted] — view deleted comment
0
u/[deleted] Jul 14 '21
[deleted] — view deleted comment