my 3d engine

Hello,

I’ve been working on a Java software rendering engine with dynamic lighting and interactable world. I think I’ve come pretty far from where I began with absolutely no idea on 3d rendering techniques. So This is what I’ve come up with:

http://s8.postimg.org/3w6q32n2d/screenshot_conxeline.png

nsMgT6OZTnA

if you view it in Youtube, the description includes a table of skip-to links and a link showing it with cubes+pyramids.

zip: https://www.dropbox.com/s/24aj6f1zl5tkod8/Conxeline.zip
no sound : https://www.dropbox.com/s/3glnrfxshd9wwp2/Conxeline%20no%20sound.zip

Also, I’m really perplexed about a bug(?) : It runs fine from eclipse, it runs fine with command prompt java -jar Conxeline.jar, but double clicking the jar makes its frames drop to 15. If anyone might be able to help explain this, I’ll be grateful. I included a .bat file that runs the java -jar Conxeline.jar for convenience, but you can type it in manually in command prompt if you prefer to avoid .bat files.

If anyone is interested in creating awesome maps to explore, let me know, there is a very clunky/rudimentary/buggy map editor that I could fix up and upload.

I would really appreciate any feedback,
Thanks!

You probably got 2 gpu’s.
Im facing this problem all the time, bat / exe / command line are executed with the highest gpu by default.
Java, however is excecuted with the weakest gpu.

Maybe you got the same thing going on?

yes, i have an integrated intel gpu and a nvidia gpu. thanks!

I have tried the “with_sound” version on my pc, it runs at a steady 50fps for both the the jar and batch version, however there is no sound. I guess the frame rate drop might have something to do with playing the sound track. Anyway, if you are doing software rendering the graphic card should have very little impact on the performance.

hmmm. the sound file is a .wav, i don’t know if for some reason that might be a problem on some computers. just to be clear, the version with sound just says “Conxeline” as opposed to “Conxeline_with_sound.” I’m no expert in making sound, i just put it together in half an hour and didn’t really study it. here’s the music class in its entirety: http://pastebin.java-gaming.org/3eabd44077a , i’ve highlighted the methods actually used. I won’t have access to another computer to test until December.

I’m not sure about the graphics card, i’m using Graphics2D calls on a BufferedImage (drawPolygon to draw everything on a BufferedImage not visible to user; drawImage to transfer from the BufferedImage to the screen; and fillRect to erase the BufferedImage). So I’m assuming this is software rendering. Especially since I have an experimental version using LWJGL that runs at a much faster fps, so I assume that if Java2D was using the gpu, it too would be running at a higher fps. Maybe actually turning on screen pixels is being done by intel’s gpu v nvidia’s gpu depending on how you run it?

That is a nice engine! Hope to see physics soon!

I think this should go in “WIP games, tools & toy projects”, not sure though.
EDIT: Besides that, tried the no sound version, engine is nice. Did you use any external libraries to do it?

ha ha, hearing feedback feels so nice. Thanks for the comments.

Anyways, to reply to both isteinvids and wesley.laferriere, the reason I didn’t put this in WIP is because my school just started, so I doubt I’ll be working on it for a long time. So unfortunately, I won’t be able to add physics anytime soon. But I am curious what you (weasley) had in mind? springs and dynamic cloth and electronics and optics and such would be way over my head. as for simple gravity and collision detection, it does exist, but only for blocks that have it enables (kind of like sand/gravel in minecraft). so if you use the 1st tool to throw blocks, it does have air-friction and gravity. if you use the 3rd tool (the exploding block one), the blocks that fly away after the explosion also have air-friction and gravity, but the physics is disabled once their velocity falls below a certain threshold (It should have checked acceleration too to avoid blocks that get stuck in midair, but I’ll fix that next update).

i did not use external libraries, but if you were to decompile and look at the source code, you’ll see there is an incomplete hardware accelerated version that uses libgdx.

I meant that you could make a game where there is a randomly generated puzzle, not just premade levels that you made. You could add so much content that way! It will set it apart from marble madness or whatever.

You could really have something going here… great job!

Quick question how does your face selection algorithm work does it ray cast or calculate with the power of gandalf? or maths, maths is fine :smiley:

Sorry for the extremely late reply, but maybe you’ll find it useful nonetheless. my face selection algorithm throws a ray from the camera towards the 3d position the cursor corresponds to and increments the ray (by min(dx, dy, dz) where dx and dy are the distance you have to travel until you reach the next x,y,or z coordinate) until it reaches a coordinate that’s not empty.

And as a general update, i worked more on the project every once in a while. the current version has been inspired a bit by avatar the last airbender, and simple earth bending concepts, basically imagine throwing boulders and raising walls in front of you. but i haven’t looked at it for over a year, so …