Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
And I was on /r/linux earlier.

They both seemed to steal their headline from Phoronix.

Adbot
ADBOT LOVES YOU

Slurps Mad Rips
Jan 25, 2009

Bwaltow!


I know it's HN but the extremely upset comments are just totes adorbs.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Ugh. There's now 80 comments pending for moderation on my blog, and most of them are trash. There are several great comments, but it feels rude to approve only those and not all of them. What should I do?

I also got a clever spam comment that almost got me, because it used the same username as another commenter who previously posted something long: "Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn't appear. Grrrr... well I'm not writing all that over again. Regardless, just wanted to say excellent blog!"

glompix
Jan 19, 2004

propane grill-pilled

I never really read HN much but haha wow some of those comments are retarded. "It's not perfect so it is terrible even though it was a casual post of a POC on a completely separate forum!"

e: missed this. this VVV

SAHChandler posted:

I know it's HN but the extremely upset comments are just totes adorbs.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Suspicious Dish posted:

Ugh. There's now 80 comments pending for moderation on my blog, and most of them are trash. There are several great comments, but it feels rude to approve only those and not all of them. What should I do?

I also got a clever spam comment that almost got me, because it used the same username as another commenter who previously posted something long: "Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn't appear. Grrrr... well I'm not writing all that over again. Regardless, just wanted to say excellent blog!"

gently caress the lovely comments, only approve the quality ones imo. That's a pretty clever idea for a spam bot though.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

Suspicious Dish posted:

Ugh. There's now 80 comments pending for moderation on my blog, and most of them are trash. There are several great comments, but it feels rude to approve only those and not all of them. What should I do?

I also got a clever spam comment that almost got me, because it used the same username as another commenter who previously posted something long: "Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn't appear. Grrrr... well I'm not writing all that over again. Regardless, just wanted to say excellent blog!"
Cleverest spam comments I've seen combine previous comment / post sentences in a way to seem legit. The lovely website URLs they always use as "contact" are a dead giveaway though.

ufarn
May 30, 2009
I unironically think getting featured on HN is one of the most annoying things to happen to you. They're the most bitter, predictable loving bunch in the world.

I'd probably feature someone's work on HN if I had it in for them.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
I read it because it's typically a good place to find new stuff. Can you recommend a less bitter place?

Blue Footed Booby
Oct 4, 2006

got those happy feet

Suspicious Dish posted:

Right, I was just curious why the rasterizer was emitting pixels in columns rather than rows.

Last page, but I don't think anyone answered this question.

Think about what a wall looks like in perspective:


What the engine in, say, Wolfenstein 3D does is cast out a ray for every column of pixels in the final viewport, and trace each one out to the first wall. This part I think you got. The key that shodanjr_gr was kind of vague about is that it uses trig to figure out how tall the wall appears to be at the point hit. It's not actually treating the wall as a surface, so it would be completely unable to figure out how to draw anything with just a ray for every row of pixels. You actually can use a row-by-row approach to render floors and ceilings.

For engines that support walls that aren't all of the same height you just factor that into the calculation of the strips height and slide the rendered strip up or down to account for player height, elevation of player's position, etc. The actual game logic is all purely 2D, and any 3D-seeming logic was accomplished via unholy space magic. There's a reason raycasting was completely abandoned once true 3D got to be truly viable.

For completeness, here's the tutorial pretty much everybody uses when writing babby's frist raycaster.

steckles
Jan 14, 2006

Blue Footed Booby posted:

The actual game logic is all purely 2D, and any 3D-seeming logic was accomplished via unholy space magic.
Rendering logic and game logic don't necessarily need to be connected. Early 2.5D fps engines worked the way they did, as far as I can tell, because occlusion is easier to calculate in 2D and a lot of complex texture mapping calculations can be reused.

Sprites in Doom, for example, have three-dimensional positions and the player has no trouble moving over or under other sprites, no space magic needed.

shodanjr_gr
Nov 20, 2007

Suspicious Dish posted:

Right, I was just curious why the rasterizer was emitting pixels in columns rather than rows.

Because its not a rasterizer :). With (basic) ray-casted rendering you generally assume that you fire one ray for each pixel in your frame buffer, get an intersection and then shade it. By imposing some limitations into the layout of the environment (e.g. only having a single "level" in view at any time), you can guarantee that, for ever pixel in a particular frame buffer column there is only going to be one singular intersecting wall covering part of the screen, with the rest being covered by the floor and ceiling (I'm simplifying a bit here). So you can cast a ray and intersect it against a 2D spatial data structure to get the appropriate wall surface and the distance from it. With the distance you can easily calculate the "footprint" of that particular wall on the screen for that single pixel. Also the intersection gives you information that determines the mapping between the wall geometry and the underlying texture. With this information and the distance you can also calculate the texture sampling "spacing" that you require. At this point, you have all the information you need to draw the wall for that particular column, so you might as well do it. That's why pixels are (usually) emitted in a column first fashion. It probably also allows you to leverage better CPU cache coherency while doing the texturing pass. The alternative would be to "store" the intersection information for each pixel and do another pass to determine texturing but that would just waste precious bytes from your 512kB of RAM that you had at the time.

PS: Doom's renderer doesn't actually work like (except for the column-major wall texture mapping) that but Wolfenstein's does :)

shodanjr_gr fucked around with this message at 02:24 on Oct 21, 2014

TheresaJayne
Jul 1, 2011

shodanjr_gr posted:

Because its not a rasterizer :). With (basic) ray-casted rendering you generally assume that you fire one ray for each pixel in your frame buffer, get an intersection and then shade it. By imposing some limitations into the layout of the environment (e.g. only having a single "level" in view at any time), you can guarantee that, for ever pixel in a particular frame buffer column there is only going to be one singular intersecting wall covering part of the screen, with the rest being covered by the floor and ceiling (I'm simplifying a bit here). So you can cast a ray and intersect it against a 2D spatial data structure to get the appropriate wall surface and the distance from it. With the distance you can easily calculate the "footprint" of that particular wall on the screen for that single pixel. Also the intersection gives you information that determines the mapping between the wall geometry and the underlying texture. With this information and the distance you can also calculate the texture sampling "spacing" that you require. At this point, you have all the information you need to draw the wall for that particular column, so you might as well do it. That's why pixels are (usually) emitted in a column first fashion. It probably also allows you to leverage better CPU cache coherency while doing the texturing pass. The alternative would be to "store" the intersection information for each pixel and do another pass to determine texturing but that would just waste precious bytes from your 512kB of RAM that you had at the time.

PS: Doom's renderer doesn't actually work like (except for the column-major wall texture mapping) that but Wolfenstein's does :)

I thought they just shot 1 ray across the middle of the screen to find where the wall was that could be seen, so on a 800x600 screen it was 800 rays for each pass. as there was no up or down in Wolfenstein so it was just how far did i go before hitting the wall....

steckles
Jan 14, 2006

One neat thing about ray casters is that you can get cylindrical and quasi-fisheye projections for free just by changing the direction you shoot rays from the camera.

Maybe not a full 360 degrees, but a little bit of distortion might be a nice effect for underwater sections or something.

shodanjr_gr
Nov 20, 2007

TheresaJayne posted:

I thought they just shot 1 ray across the middle of the screen to find where the wall was that could be seen, so on a 800x600 screen it was 800 rays for each pass. as there was no up or down in Wolfenstein so it was just how far did i go before hitting the wall....

A Wolf3D-style raycaster does shoot 800 rays (or W for whatever the pixel width of your viewport is). There is no concept of "middle of the screen" when doing this recasting though, the vertical position of the pixel at which you cast the ray doesn't matter precisely because there is no "up and down" (meaning that there isn't any walls placed above other walls, multi-floor level layouts, all the walls have the same heigh, etc). The layout of the level is represented in a purely two dimensional way.


steckles posted:

One neat thing about ray casters is that you can get cylindrical and quasi-fisheye projections for free just by changing the direction you shoot rays from the camera.

Maybe not a full 360 degrees, but a little bit of distortion might be a nice effect for underwater sections or something.


How are you handling your props and ceiling geometries? Standard 3D models?

steckles
Jan 14, 2006

shodanjr_gr posted:

How are you handling your props and ceiling geometries? Standard 3D models?
It's all part of the level geometry. Sector over sector is achieved by allowing sector edges to have multiple neighbours. When multiple neighbours are encountered, the visibility ray is recursively traced into each "window" between the current sector and it's neighbours. Because the far part of a floor column is always higher on the screen than the near part, and the reverse for ceiling columns, only two numbers are needed to keep track of the drawable area of each column and no depth buffer is needed. This also allows early termination of the ray tracing.

No preprocessing is required so sectors can be added or removed, vertices moved, and connectivity modified at runtime. Doors could be implemented by just moving the sectors associated with them. I do have plans to implement an "instancing" system where lists of sub-sectors could be referenced in multiple places. This would mean I'd only have to model a door once, for instance, and re-use the sectors wherever they're needed, rather than including the same geometry over and over again.

toiletbrush
May 17, 2010
Thats so awesome...I've been meaning to write a raycaster since I first saw Wolfenstein but never quite gotten round to it (apart from a lovely one I wrote in AMOS when I was about 12) and I think this is the encouragement I need. The glitchier the better.

Does your sector-over-sector thing allow for rotating sectors for things like doors that swing open? Does your engine support reflective walls? You could do some really mental stuff with walls/portals that modified or translated the cast ray before it carried on going, like reflections/refraction and Portal-style teleports.

toiletbrush fucked around with this message at 11:06 on Oct 21, 2014

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
I picked up a book at a fleamarket around 1996 which does a really good job of explaining all the details needed to build a raycaster.

Blue Footed Booby
Oct 4, 2006

got those happy feet

toiletbrush posted:

Thats so awesome...I've been meaning to write a raycaster since I first saw Wolfenstein but never quite gotten round to it (apart from a lovely one I wrote in AMOS when I was about 12) and I think this is the encouragement I need. The glitchier the better.

...

Dooooo iiiiiiit. It's a lot of fun, and you can get the basics working in a weekend even if you're terrible like me.

steckles
Jan 14, 2006

toiletbrush posted:

Does your sector-over-sector thing allow for rotating sectors for things like doors that swing open?
Yeah, as long as all relevant sectors remain convex, doing swinging doors is pretty easy. They'd probably be better implemented by clipping a separate set of sectors against the level geometry, sort of like the polyobjects added to later versions of the Doom engine.


toiletbrush posted:

Does your engine support reflective walls? You could do some really mental stuff with walls/portals that modified or translated the cast ray before it carried on going, like reflections/refraction and Portal-style teleports.
Non-contiguous sectors can be linked, with proper transformation of the ray. If the edges being linked aren't the same length, it results in a weird magnification or minimization effect. I actually tried a mirror effect for glass walls where reflected and refracted rays were calculated and then blended together based on the Fresnel term. Looked cool, but the overdraw hurt performance quite a bit. It was also kinda getting away from the spirit of the whole thing.

TheresaJayne
Jul 1, 2011

Blue Footed Booby posted:

Dooooo iiiiiiit. It's a lot of fun, and you can get the basics working in a weekend even if you're terrible like me.

of course you could also embedd this into your game... altbhough its a bit slow

https://github.com/POV-Ray/povray/tree/3.7-stable

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Blue Footed Booby posted:

Last page, but I don't think anyone answered this question.

Think about what a wall looks like in perspective:


What the engine in, say, Wolfenstein 3D does is cast out a ray for every column of pixels in the final viewport, and trace each one out to the first wall. This part I think you got. The key that shodanjr_gr was kind of vague about is that it uses trig to figure out how tall the wall appears to be at the point hit. It's not actually treating the wall as a surface, so it would be completely unable to figure out how to draw anything with just a ray for every row of pixels. You actually can use a row-by-row approach to render floors and ceilings.

With this approach, you only have three surfaces you're hitting for any given column: the floor, the ceiling, and the wall. steckles's screenshots were showing more than three surfaces per column, so I assumed it was more like a traditional rasterizer.

Neurion
Jun 3, 2013

The musical fruit
The more you eat
The more you hoot

After pulling an extreme all-nighter, I've finally got the newest feature of my pet project complete. The project is a Visual Studio .Net application that allows you to open files and view the byte stream as if it were graphical data in a multitude of modes. These rendering modes include bit depths of 1, 2, 4, 8, 16, 24, and 32bpp. There are also various ways to interpret the byte streams, such as a flat linear image (supporting Windows, PSX and N64 RGB element arrangements) or tiled graphics from a few different video game systems (GameBoy, PSP, GBA). Before I brag about the newest feature, here are a few screenshots:

The menu texture for a very handsome devil, from Persona 4.


Some item textures from Zelda OOT.


Monster Medal tiles from Dragon Warrior III.


And now, the super awesome feature. I've made it so the program is capable of opening another process and reading its memory, using the other process' memory as the source of the graphical byte stream, and updating in real time! Technically impressive, but of much more specialized utility than opening files. I'm mostly using it to watch process' memory changing in a graphical manner, so I can find patterns in the organization of structures and other elements in memory.

That didn't stop me from oggling a DOS program's framebuffer, though.


There's still a few bugs to work out of the new feature, specifically the fact that it only maps the target process' memory pages upon opening it, and they may change as the program executes. Old pages may be freed and new ones may be committed, which can lead to exceptions when I attempt to read memory that is no longer there. I'm also planning on replacing that maroon bar on the right side of the form with a graphical representation of the valid memory blocks, though that could prove to be troublesome if I wanted to keep it all to-scale, considering how small some of the blocks are and how spread out they can be in the virtual memory space.

Still, not a bad update for a sleepless night's work.

hendersa
Sep 17, 2006

Neurion posted:

Awesome stuff.

Now this... this I like. :golfclap:

The thing I admire about these sort of projects is that you never know when they'll turn out to be the perfect super-useful tool for some esoteric problem you come across when working on something completely unrelated. When I am interviewing applicants for a developer job, these are the sort of personal projects that I like to see people working on.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

toiletbrush posted:

Thats so awesome...I've been meaning to write a raycaster since I first saw Wolfenstein but never quite gotten round to it (apart from a lovely one I wrote in AMOS when I was about 12) and I think this is the encouragement I need. The glitchier the better.

You totally should, they're pretty straightforward (its 2D!) but its also pretty cool (wolfenstein clone!) and you'll learn a lot about alternative rendering approaches.

Reminds me I should really go back and finish my raycaster. I got the basic rendering and walking around working perfectly, and I got texture mapped walls in, but when I tried to do texture mapped ceilings I couldn't get the math right and it kept drawing the textures totally wrong. The rest of the scene looked great though if you can accept flat shaded ceilings and floors. I couldn't have been far off either...

Programmer Humor
Nov 27, 2008

Lipstick Apathy
I started looking at L-systems. Starting with only a single line segment, then replacing that with a slightly thicker line segment, and if it's new, add one or two new line segments at the end of it. I also had to add a special rule to not make the trunk split off until a few cycles in. New line segment lengths and angles are slightly randomized.

steckles
Jan 14, 2006

Neurion posted:

After pulling an extreme all-nighter, I've finally got the newest feature of my pet project complete.
...

Still, not a bad update for a sleepless night's work.
That is pretty much the coolest thing. I could see that being super useful for reverse engineering old applications.

Zaphod42 posted:

Reminds me I should really go back and finish my raycaster. I got the basic rendering and walking around working perfectly, and I got texture mapped walls in, but when I tried to do texture mapped ceilings I couldn't get the math right and it kept drawing the textures totally wrong.
You basically need to do full perspective correct texture mapping for drawing texture floors and ceilings. If you interpolate 1/z in your pixel drawing loop, you can get the world-space position of every pixel by doing something like
code:
pixel_world_coords_x = player_position_x+view_ray_x*(1.f/interpolated_inv_z)
pixel_world_coords_y = player_position_y+view_ray_y*(1.f/interpolated_inv_z)
From there, the texture coordinates are just the world coordinate modulus your texture dimensions.

Along those lines, I totally recommend anyone interested look up Chris Hecker's old texture mapping articles. Very useful theory and it covers stuff like sub-pixel correction that can dramatically improve the quality of your results.

Tres Burritos
Sep 3, 2009

Programmer Humor posted:

I started looking at L-systems. Starting with only a single line segment, then replacing that with a slightly thicker line segment, and if it's new, add one or two new line segments at the end of it. I also had to add a special rule to not make the trunk split off until a few cycles in. New line segment lengths and angles are slightly randomized.



L-Systems are so much fun. They're a great way to familiarize yourself with whatever graphics api / language that you're using.

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

Tres Burritos posted:

L-Systems are so much fun. They're a great way to familiarize yourself with whatever graphics api / language that you're using.

They're cool because they're so trivial, but can produce such neat results.

tef
May 30, 2004

-> some l-system crap ->

Tres Burritos posted:

L-Systems are so much fun. They're a great way to familiarize yourself with whatever graphics api / language that you're using.

Same.

A → B-A-B
B → A+B+A

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

tef posted:

A → B-A-B
B → A+B+A

This should be your avatar, with something along the lines of "recurse to view avatar" beneath it.

glompix
Jan 19, 2004

propane grill-pilled

Centripetal Horse posted:

They're cool because they're so trivial, but can produce such neat results.

I just learned about these now and oh my god I can't wait to start loving with them. I have just the project too. Thank you, goons, for throwing out a topic that I can easily grasp for once. :)

I still want to get into ML. Just all. that. math. :stare:

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?
This is my porting partner, not me, but still:



Dude got Hot Tin Roof running on XB One. Apparently didn't take long at all, once the stupidity around getting it working as a devkit was done.

(from the looks of things, Unity on XB One can't do deferred shading, or it's otherwise buggy... clearly he has a lot of work to do before it's shippable ;))

Jo
Jan 24, 2005

:allears:
Soiled Meat

glompix posted:

I just learned about these now and oh my god I can't wait to start loving with them. I have just the project too. Thank you, goons, for throwing out a topic that I can easily grasp for once. :)

I still want to get into ML. Just all. that. math. :stare:

Try playing with Weka to observe the behaviors of different algorithms and check out Data.gov for some datasets. Or do clustering. I love clustering. It's machine learning for people who suck at calculus. :allears:

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost
A new version of Awful Forums Reader is coming...



And it will be pointless glorious.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Drastic Actions posted:

A new version of Awful Forums Reader is coming...



And it will be pointless glorious.

Ahaha the schism is upon us!

Sereri
Sep 30, 2008

awwwrigami

pokeyman posted:

Ahaha the schism is upon us!

You should make a Windows Phone version of Awful.app out of spite

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Sereri posted:

You should make a Windows Phone version of Awful.app out of spite

And It'll be better than mine :v:.

This is my excuse to use the Xamarin tools I now get for free. All of the forum parsing logic is done, since it was in a PCL. Note that I'm also refactoring it to fix the mistakes and other bugs in it.

So really what I need to do is UI. Which, if you look in the Glitch thread... Yeah, it'll be awhile.

Drastic Actions fucked around with this message at 16:32 on Oct 27, 2014

LP0 ON FIRE
Jan 25, 2006

beep boop

Blue Footed Booby posted:

Last page, but I don't think anyone answered this question.

Think about what a wall looks like in perspective:


...

For completeness, here's the tutorial pretty much everybody uses when writing babby's frist raycaster.

Thank you so much for posting this, it really blew my mind on the simplicity, and I'll find time to do this. It will probably be much easier to do than some of what was described on the site, because you could use built-in image manipulations, even in Javascript.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

LP0 ON FIRE posted:

Thank you so much for posting this, it really blew my mind on the simplicity, and I'll find time to do this. It will probably be much easier to do than some of what was described on the site, because you could use built-in image manipulations, even in Javascript.

Yeah raycasters are beautifully simple. They cast a 1D line of rays, which use a 2D set of data in order to fake a 3D perspective.
That's just cool.

Adbot
ADBOT LOVES YOU

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

glompix posted:

I just learned about these now and oh my god I can't wait to start loving with them. I have just the project too. Thank you, goons, for throwing out a topic that I can easily grasp for once. :)

I still want to get into ML. Just all. that. math. :stare:

They are great fun. In fact, I decided to roll another L-System thingamabob of my own.






Pictured are a capillary/tree thing, a dragon curve, a Hilbert curve, a Koch curve, a Peano curve, a Sierpinski gasket, a non-intersecting Sierpinski gasket, and some random baloney I made up because I like even numbers and I didn't want to post seven images. The colors are because I can.

In unrelated news, Chrome doesn't put a squiggly red line under "thingamabob."

Edit: I'm happy to share the code if you or anyone else want it. Be warned, though, it's ugly. I changed direction about a dozen times, and there's all kinds of things in classes that shouldn't be classes, the logic is illogical, the program structure is bizarre, and I think interfaces even made a brief appearance. Also, it's written in Monkey

Centripetal Horse fucked around with this message at 08:38 on Oct 28, 2014

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply