Live data from Hacker News

Making Graphics Like it's 1993

staniks.github.io

111–120 of 169 posts

Re: Making Graphics Like it's 1993

#113
post #31

Graphics programming in the early to mid 1990s was pretty fun: write pixel data into the memory-mapped video RAM and it appears on the screen! A pointer to 0xA0000 was all you needed - no API or anything. The reason for the non-square-pixel 320×200 VGA mode they mention was that the video buffer took 64000 bytes, which fit into a 16-bit segment, making addressing it easy in 16-bit code/CPUs.

Until VGA came along....the story was much more complex.

No, I'm talking about VGA. Super VGA is where it got more complicated, with its many variations, higher resolutions, and higher bit depths.

Re: Making Graphics Like it's 1993

#115

If you want to play with software rendering, here's probably the shortest code that will get an ARGB8888 2D array from main memory to the screen efficiently for all platforms using SDL2 in C https://gist.github.com/CoryBloyd/6725bb78323bb1157ff8d4175d... you'll need to do the translation from a 320x200x8-bit palletized framebuffer to ARGB yourself ;) If you want to get inspired by what can be done with palletized fra…

It's certainly the most rudimentary. Small optimisation on the inner-loop would be to pre-calculate the scanline offset before going into the pixel loop:

    int s = y*screenRect.w;
    
    for (int x = 0; x >3, y+frame, x+frame);
    }

Re: Making Graphics Like it's 1993

#116
post #10

I just noticed that this might be one of the rare shooters with a female protagonist: the cat has a calico pattern, and those are almost always female ( https://en.wikipedia.org/wiki/Calico_cat ).

I doubt it was intentional, but in general, I am not impressed by that and don't find any value in that. Same with Hollywood's depiction of women knocking out guys twice their size. Unrealistic, ridiculous, and harmful.

not harmful. why should women in action films need to be held to a higher standard the men?

Hollywood's depiction of action movies in general is unrealistic. Stereotypical Good Guy gets in a fist fight with a Random Thug, and after trading blows for a while the Good Guy knocks out Random Thug and carries on with the rest of the movie without a problem. No bruising, no eye swelling shut, no broken ribs restricting movement or breathing, no loose teeth, no broken fingers, no sore wrists from mis-angled punches.

Re: Making Graphics Like it's 1993

#117
post #2

This is taking a lot of inspiration from Doom, but the actual raycasting engine is more like Doom's predecessors, the most well-known of which is probably Wolfenstein 3D: perpendicular walls, constant floor and ceiling height. Wolf3D didn't have textured floors and ceilings because of performance reasons, but several other similar games had them. Doom and IIRC Duke Nukem as well used a BSP engine which was much more…

> Duke Nukem as well used a BSP engine The Build engine didn't use BSP, it treated connections between sectors as portals and rasterized the walls as (90 degree rotated) trapezoids while performing clipping against those portals. This allowed it to have dynamic wall geometry (e.g. moving trains, rotating light fixtures, etc) as well as "room-over-room" setups as long as you couldn't see both rooms at the same time (i…

The funny thing is that looking backwards, I would never use a grid of squares for a raycaster like wolfenstein3d did.

If I were to do a raycaster today, I would use convex sectors with portals, basically like duke nukem, but constant wall heights. You can do drawing very simply by just doing a linear pass across the sector, recursively stepping into other sectors.

Then you can at least do arbitrary level geometries.

Re: Making Graphics Like it's 1993

#118
post #113

Earlier quoted context omitted.

Until VGA came along....the story was much more complex.

No, I'm talking about VGA. Super VGA is where it got more complicated, with its many variations, higher resolutions, and higher bit depths.

I think GP is referring to EGA which also used address 0xA0000 but you had to program it in it a planer mode of 16 colors out of a palette of 64. VGA provided backward compatibility with this but introduced the 256 color modes with mode 13h being the linear addressable 320x200 res mode, however this mode sacrificed 3/4 of the video memory. This mode was also referred to as "chained" mode as it chained all 4 bitplanes together for convenient linear addressing. There was also unchained mode, sometimes referred to as mode-x which allowed you to access all 256kb of video memory, resize the virtual screen, page flipping, etc. at the cost of compute overhead. Lots of tradeoffs to be made in those days. Some amazing looking 16 colors VGA games were produced in the early 90s, one that comes to mind is Gods by Bitmap Brothers.

Re: Making Graphics Like it's 1993

#119
If there's enough room, you could add special palette indexes that stay constant or diminish more slowly with distance. To give a glow effect for lights, torches, etc. I always appreciated this effect in Quake.

EDIT: Oh nevermind. I guess brightmaps are more flexible.

Re: Making Graphics Like it's 1993

#120

This is so great. Another fun trick we used in the 90s was palette animation -- by swapping the palette you can create incredibly cool effects at a low runtime cost.

I recall that Diablo 1 (and 2) has a lot of enemies that are essentially the same sprite but different palette. Is it the same trick?

it used to be a hardware thing, so if your pixels were represented by a nibble, and the definition of the color for each of the 16 possible value is in table the hardware references, you just update that table (on a vsync, or even an hsync) and you could get cool animations effects (for the time)

random example from the Atari 800xl https://www.youtube.com/watch?v=uPjLZ4MVKCc (you can see how slow it is to draw a scene, but the animation effect due to pallete rotation is really fast).

Post reply on HN