Jump to content
IGNORED

Voxel Flight POC


42bs

Recommended Posts

This is a small voxel flight prove of concept. I wanted to make it a demo for SV, but simply had no time.

So here the current version.

Numbers are: ms to render the screen, frames to render the screen and height of "flyer".

Here a short "hand recorded" video:

voxel.cof

 

  • Like 23
Link to comment
Share on other sites

9 hours ago, Sauron said:

Looks nice. I know there's been several voxel engines that have floated around here, including DrTypo's one that he uses in Fallen Angels. I'd like to see more experimenting with them, personally.

I've always wanted to experiment with 3D splines, nerbs, and voxel for the Jag and combine the three... Voxels seems very cheap to shade very fast, can be used as sprites for very fast OP handling, and can be copied several times over in memory to fill a screen line very fast with emphasis on volumetrics instead of the slow process of drawing quads or triangles for 3D... all there's needed is a good strong spline and nerb based realtime 3D engine with the Motorola having better access main memory and cartridge for solid real 3D representation handling fast wireframe while the Jaguar do what it does best; handle 2D images efficiently... at least in theory, but all of that theory is a curiosity at this point with nothing to back everything I said.

  • Confused 2
Link to comment
Share on other sites

The 'problem' with the voxels (btw same for raycaster like Doom or Wolfenstein) you cross a lot of DRAM page boundaries as screen memory is from left to right not up to down.

 

I will have to try and rotate my screen by 90° and draw lines instead of columns. My bet, at least 50% quicker.

  • Like 1
  • Haha 1
Link to comment
Share on other sites

3 minutes ago, 42bs said:

The 'problem' with the voxels (btw same for raycaster like Doom or Wolfenstein) you cross a lot of DRAM page boundaries as screen memory is from left to right not up to down.

 

I will have to try and rotate my screen by 90° and draw lines instead of columns. My bet, at least 50% quicker.

 

What about vertical object strips arranged horizontally?  

  • Like 1
Link to comment
Share on other sites

25 minutes ago, CyranoJ said:

 

What about vertical object strips arranged horizontally?  

Not sure what you mean.

The "classical" voxel engine draws for each X vertical stripes where the height is determined by the map scanned in Z direction.

I am not using the painter algo, so it draws only a new column if it is "higher" than the one in front.

So if I wanted to draw horizontally, I need to know the colors for each pixel.

 

One optimization could be to prepare the vertical stripe in GPU RAM and then draw it completely. If only GPU RAM could be accessed 8 or 16 bit wise :(

 

Edited by 42bs
Link to comment
Share on other sites

18 minutes ago, CyranoJ said:

I mean if you have single/double pixel wide objects 2x200 arranged horizontally so at 0,2,4,6 etc

 

that way your vertical 'stripe' is 'horizontal' (sequential) in RAM.

Ah, you mean OP objects. Ok, I guess I get the idea. So each column is an object. The blitter writes linearly into the object.

But the minimal X size of an object is 1 phrase, which means here 4 pixels.

Anyway an idea to keep in the notebook.

  • Like 1
Link to comment
Share on other sites

I've always been interested in voxels, but never understood the intracacies of rendering.

 

E.G you use a height map for the terain but do you only plot the surface (single pixel layer) or as a solid ( multiple layers )

 

But I guess that depends on how you interact with the terrain ( you can blow holes in it ).

 

Anyhoo always seemed to me that it created some very realistic terrain to roam around.

Link to comment
Share on other sites

4 minutes ago, saboteur said:

I've always been interested in voxels, but never understood the intracacies of rendering.

 

E.G you use a height map for the terain but do you only plot the surface (single pixel layer) or as a solid ( multiple layers )

 

But I guess that depends on how you interact with the terrain ( you can blow holes in it ).

 

Anyhoo always seemed to me that it created some very realistic terrain to roam around.

This one is good to learn:

https://github.com/s-macke/VoxelSpace

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

21 minutes ago, RollOut said:

That looks really cool. I may have misunderstood, @42bs, is this part of a project you are working on, in more like a stand alone proof of concept?

I wanted to make a demo for Sillyventure but was to late to finish in time.

I will polish it a bit and then publish code as usual. 

 

Link to comment
Share on other sites

12 hours ago, 42bs said:

Ah, you mean OP objects. Ok, I guess I get the idea. So each column is an object. The blitter writes linearly into the object.

But the minimal X size of an object is 1 phrase, which means here 4 pixels.

Anyway an idea to keep in the notebook.

There is the "FIRSTPIX" field in the BitmapObject that can be used to start on a subboundary of the phrase.

Maybe you can use it to set a bitmap object of 1 phrase wide with the firstpixel as the 4th one.

 

Nether used it myself though (so didn't know if it works properly in any cases ;))

 

Link to comment
Share on other sites

9 minutes ago, SCPCD said:

Ah, you mean OP objects. Ok, I guess I get the idea. So each column is an object. The blitter writes linearly into the object.

Doesn't that just move the overhead from the blitter to the object processor though? Or does the OP handle all these objects more efficiently somehow when it walks the list?

Link to comment
Share on other sites

4 hours ago, jguff said:

If you have two maps (color and height), are you interleaving the the two maps together to avoid crossing page boundaries constantly?

Currently it is only one map. The height defines the color. 0..10 blue, 11..100 green, 100..200 brown and the rest grey.

 

Link to comment
Share on other sites

Commanche (1992) had tilt. When you fly into a mountain, you see that they draw squares ( a bit like traces in Quake I ) .. not columns. Commanche has a z-buffer. So why not port that engine? Draw back to front const-z stripes .. Ah it is a bit complicated when you pitch .. but basicaly you coudl flood the blitter with DESTZEN, flat shaded squares and later use the z data to render other objectes.

 

I still think that the fast JRISC is better suited for some intelligent rendering like Quadtree.

 

It may be faster to rotate 90° after the rendering. There is suprising fast planar to chunky code out there for other systems. On Yag you could blit a whole DRAM page into SRAM, then let JRISC rotate it by 90° and then blit back. Use OP to create 32x32 tiles on screen. Or better use some running / staggered system and have 64x16 tiles ..

  • Confused 8
Link to comment
Share on other sites

On 8/17/2022 at 5:27 AM, 42bs said:

This one is good to learn:

https://github.com/s-macke/VoxelSpace

The images on the website reminds me of the old "Vistapro Landscape" program... it had a feature where one could view a "fly through" scene using some low vector or fractal looking scene before you actually render the fly-through... I remember thinking to myself when dealing with the old program "wouldn't it be neat to have a polygon based 3D engine that rendered as fast as Voxels (high details) do without the overhead of a limited polygon count based 3D engine...?" But then again that's a bit of a dream engine on my part; it has been fun doing research on that sort of thing over the years.

 

https://youtu.be/do1LWcPPtew

Edited by philipj
Link to comment
Share on other sites

Here's your chance to get your feet wet philipj!  Made a screenshot of a hello world for you.

 

I dumped the JagStudio zipped contents into C:\JagStudio

Added C:\JagStudio to the PATH

Made a hello folder under C:\JagStudio\projects\basic

Create a hello.bas file with the text " rapPrint "Hello philipj" "

Copied the ASSETS folder and asset.txt, rap*.s files from the print project to the hello project

From a Administrator level PowerShell shell went into the C:\JagStudio folder and executed "build hello ROM"

 

hello.thumb.PNG.b7fdf0ddc4dfb7fd8d899608ce0e860f.PNG

 

  • Haha 5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...