I concur with adekto. What you already did is awesome, yet you just do another “big potential inefficiency”, that’s amazing!
Thanks guys, you’re keeping me going Oh noes, welcome to the bugworld. I know that place too well.
It’s done, we’ve indeed gained a bit of extra performance, let me see what I can do with it.
Found another optimization – precompute the floor and ceiling gradients. Demo1 is now close to 60/30 FPS with half/full resolution. Runs veeery smooth now Current bins:
demo1_halfres.bin (70.4 KB)
demo1_fullres.bin (70.4 KB)
Demo3 runs fast as hell too, I’ve doubled the resolution now. I like these results so far. Now I definitely need to add the generalized floor textures.
Let me note an optimization idea here:
The function that changes color intensity (brightness, for distance fog/dimming) is expensive, which is especially bad since it is a per-pixel operation. The reason it’s expensive is the way I’ve constructed my general 256 color palette: the color index encodes its RGB value as rrrgggbb – this proved useful and convenient, but not performance-friendly for the use case at hand, because adding an intensity requires dissecting the index into RGB components, then adding the intensity to each, clamping and merging it all back into the index value.
So I’d like to fix this by encoding the pixels not as RGB, but a color model that is based on intensity, such as YCbCr. The colors would then be sorted by intensity in the palette and changing brightness would be a matter of adding and offset to the color index. I can see a big potential here.
Researching the color models:
From these I have to choose the one that looks closest to light diminishing, which seem to be the value (HSV)? The other two go towards complete white to the left, which could only be good if the environment was supposed to look like a paper model In reality most materials are very absorbing to specific wavelengths and don’t appear white even in very bright illumination.
On the other hand, adjusting luma (YCbCr) seems to keep the nice colors in the dark (which could however look unrealistic as humans don’t see colors in dark).
Anyway, I could as well make this a compile-time option to make everyone happy.
It could also be interesting to allocate 4 bits to the intensity component and only leave 4 bits to the color component, because human eye is much more sensitive to intensity. This would allow for much smoother gradients at the floor/ceiling.
One thing popped to my mind regarding a piece of your screenshot below:
As the wall is a bit tilted around y-axis, shouldn’t the lines go always downwards towards the left? Now the line goes up and down one pixel even if the main direction is downwards. This might be because of rounding problem, or related to insufficient precision of the values. Maybe the cosine correction, which you do for the calculated distance, is the reason for this (?).
These are textures on the wall (obviously buggy in this shot, no U coordinate was computed) – I have an optimization that from certain distance renders textures less precisely but faster. This may be caused by it (not 100% sure, will check that). This can be seen more clearly here:
I understand your concern. After all, it is a high-quality 2.0" TFT screen. Any unrealistic artefacts may distract from near-Matrix level immersion.
(don’t be offended… I am just loving it how thoroughy you all think about what you develop. It’s part of the fun!)
Humans also can’t jump higher than their own height or grow to twice their height when eating mushrooms.
Realism is overrated.
Besides which, that’s why I always go Khajiit in Skyrim.
Maybe if you put one Pokitto in front of each eye Wait wait… how about a VR hat for two Pokittos? I think I need to order another Pokitto and a pair of lenses.
I can sign under this, games get mostly boring the more realistic they become.
I kinda like Argonians and Orcs as races, but I picked a different race in each game to have a completely new experience every time.
So this seems to be the new uberpalette:
16 brightness levels is going to make really nice shadows. The weakness is saturation for which I allocated only 1 bit, so each color has only a saturated and half saturated version – if you add grey to it (as zero saturation) that’s three saturation levels.
I find this happens a lot.
Even with graphics, I sometimes find that realistic graphics end up looking worse than cartoony graphics.
E.g. I prefer the cartoony charm of Wind Waker to the harsh realism of Twilight Princess.
With survival games, the hunger system often ends up being an irritation rather than something enjoyable.
And sometimes even simple things like limiting movement speed to what’s realistic for a human can be a pain in the neck.
I sometimes want to try another race out, but I can’t shake the habit.
Nice pallet, if you hard code that the first index per row is always black you free up a hole 16 colors you can use elsewhere like the hud
Only the top left should be black, the other colors are just very dark shades of other colors (maybe I could make them a bit brighter). That’s what I had to think about a lot actually, because with HSV all colors converge to black as value goes to zero – and also all colors go towards grey as saturation goes towards zero, which I had to manage too (I separated the grey into only the first row).
Ever played Crackdown on xbox360? That really shows that unrealistic speed and power is way more fun…
I had not, but looking at a video I see what you mean.
I actually find that being superhuman gets boring after a while. It’s often the journey to that pinnacle that is the most interesting bit…
The rest of the game then becomes a pedestrian playground if you’re not suitably challenged.
That seems only next to realistic. I always found arena shooters extremely fun because of the extremely exaggerated speed (like this – except I’ve switched to OpenArena from Quake III). I’ve never been the COD kind of person
BTW this makes me wanna make an arena shooter with the raycasting engine. Ooooh yes, that would be cool. Just not sure about the controls. Will have to try it.
Being very powerful (fast, strong, durable, …) and still being challenged is not in contradiction, you just have to scale the opponents accordingly.
Some results of the HSV conversion:
Note that most textures didn’t survive the conversion in the original state and are very desaturated (will try to fix), however the shadows are super smooth as can be seen, and we’ve gained additional performance and code simplification (don’t have to precompute color ramps).
picks jaw from floor