Progress Thread - New demo - Cobra Mk III (18-May-08)

A full (6DOF) 3D engine for TI-83 based calculators.

Moderator: qarnos

User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post by driesguldolf »

Whoa... *stares*
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Load New Commander (Y/N)?

A really impressive demo, as always; even more impressive considering the way that the model has been imported! :)
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

O.O nice!
Image Image Image
Duck
Sir Posts-A-Lot
Posts: 231
Joined: Sat 18 Dec, 2004 3:38 am

Post by Duck »

Whoa, I'm totally impressed qarnos! The FPS is incredible given the amount of detail. Also cool to see that drawing/clipping/culling issues seem to have been resolved now.

Is anyone aware of games or applications using this library?
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

Duck wrote:Also cool to see that drawing/clipping/culling issues seem to have been resolved now.
Well, mostly resolved. It won't crash but I'm aware of one case where things wont quite look right.
Is anyone aware of games or applications using this library?
Not yet, since the only source release available is from several years ago :P

I still have some work to do on the model conversion tools to make it useful, but hopefully I'm not too far away from being able to release something usable.
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

O_O.

%!H!OPH!*(Y!@! That is incredible!

Even if you dont have the time to commit to a game, a simple model viewer would be awesome on its own :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

tr1p1ea wrote:Even if you dont have the time to commit to a game, a simple model viewer would be awesome on its own :).
Well, that's the plan for the moment. The initial release will just be a basic model viewer - maybe someone else will be able to make a game out of it. I wouldn't mind taking a crack at Elite, though. Expect a release sometime in 2015 ;)

Here's an updated version of the demo which you, in particular, might enjoy. It's an experiment in greyscale stars... sort of. I basically turn the stars on and off every frame. It needs to run on an SE to get a high enough frame rate to have the desired effect, but looks ok.

It also fixes a problem with the object sometimes jittering all over the place when you roll the camera, like you saw in the first screenshot a few posts back.
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

I've just been playing around with some basic lighting effects and it looks promising, especially given how little work went into it :P Still a little way to go though to get it working how I would like.

Image

There are two lighting methods: point source and infinite source.

Infinite source just takes a vector representing the direction the light is coming from.

Point source takes a point in world-space and calculates the light vector from this point to the object. The vector is only calculated to the centre of the object, not each vertex (for obvious reasons), so it won't look quite right when an object is close to the point source, but it is a good approximation.

Only one light may be defined, although it can be changed in between objects if you desire.

It isn't as time consuming as the frame-rate in the screenshot suggests - the coriolis station from the other demo is still there - slightly off screen - eating up my t-states.
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Lighting too? Oh, how you spoil us. Looks excellent! :)

How are you calculating the dither pattern?
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

benryves wrote:Lighting too? Oh, how you spoil us. Looks excellent! :)

How are you calculating the dither pattern?
I have 9 8x4 pixel patterns set up, from 0/8ths to 8/8ths coverage. The dot product from the shading calculation gives a value between 64 (fully lit) and 0 (not lit). Since the patterns are stored sequentially in memory and are each 4 bytes, I just rotate the value right one place and mask out the two lowest bits to give a byte offset into the pattern array.

It is a little buggy in the shading - it doesn't seem to be calculating the offset correctly, hence the patterns seem to shimmer a bit, but I didn't get a chance last night to investigate it.

Unfortunately, I am going to have to redo some of the model rendering code to be able to elegantly handle lighting. This was just a hack built on top of the backface culling code, since they essentially do the same thing anyway.
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

A less buggy version of lighting. I just need to add support for an emission value now.

Image
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Wow, looks great and runs smooth! X-Wing 83 maybe? :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

qarnos wrote:I just rotate the value right one place and mask out the two lowest bits to give a byte offset into the pattern array.
Does it look worse if you don’t mask out the last two bits? I can imagine that a clever dither pattern could allow achieving finer shades that way.
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

CoBB wrote:
qarnos wrote:I just rotate the value right one place and mask out the two lowest bits to give a byte offset into the pattern array.
Does it look worse if you don’t mask out the last two bits? I can imagine that a clever dither pattern could allow achieving finer shades that way.
That's not a bad idea!

What do you think:

Image

Edited to add:

If anybody wants to try this on-calc, you can download the file here.

There are also two new keys: '(' and ')' will increase/decrease the size of the projection window. (On PindurTI, use '[' and ']')
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

I was doing some work today and deleted some code I shouldn't have, but it did produce a pretty cool screenshot :)

One of the techniques I am using to pick up some speed with sending data to the LCD is to keep two buffers - one for the current frame, and one for the last - and only send the bytes which have been altered. It's a kind of "dirty rectangles" scheme.

This screenshot illustrates it quite nicely. The code I removed (and quickly replaced!) was the code that cleared all the buffers at the start of the program to ensure everybody agrees on what is currently on the LCD. Without that code, you can actually see which parts of the LCD are updated.

Totally pointless, but it looks cool:

Image
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
Post Reply