Hillsguy
@hillsguy.bsky.social
150 followers 30 following 64 posts
hi hemlo i develop videogames and draw (sometimes) my games: https://samael-kethill.itch.io
Posts Media Videos Starter Packs
hillsguy.bsky.social
Does anyone know how Climax Studios implemented shadow maps on PS2 and PSP in Silent Hill: Origins and Shattered Memories?
hillsguy.bsky.social
Got bizarre dream bazaar to work with portmaster
Not quite butter smooth, but it works
hillsguy.bsky.social
The Future Sound Of London - Room 208
hillsguy.bsky.social
(Textures by Makkon)
hillsguy.bsky.social
Was wondering why vertex lighting looks ugly in linear RGB compared to sRGB
Turns out it's due to interpolation in linear color space. Interpolating sqrt(col) fixes the issue
I also tried sqrt(1/col) but it looks wrong on smooth normals
I wonder if this can be applied to lightmaps too
Regular vertex lighting in sRGB Regular vertex lighting in linear RGB Vertex lighting in linear RGB with sqrt(col) interpolation Vertex lighting in linear RGB with sqrt(1/col) interpolation (I use invsqr distance attenuation)
hillsguy.bsky.social
Car model is from Need for Speed: Undercover (J2ME)
hillsguy.bsky.social
Experimenting with normals for spherical environment mapping
#gamedev #indiedev
Reposted by Hillsguy
skilful.bsky.social
This is a great thread @hillsguy.bsky.social, I'll add a bit more context here for anyone interested.

Yes there's no fancy sim - it just uses a water interaction buffer as a target for the particle system rendering, so we could use the power of particle system we already have.
hillsguy.bsky.social
Decided to check out how water is rendered in Counter-Strike 2.

Given how interactive water in CS2 is, I expected to see some cellular fluid simulation, but turns out they just use a low-resolution off-screen buffer with flat 2D decals used for various aspects of water. Reminds me of HL2 water :)
hillsguy.bsky.social
Wow, thanks for those insights and for your repost!
Effects like this deserve more attention, I was surprised that there's no related publications on Valve site
hillsguy.bsky.social
Not really. Gradient maps are similar to palettes, but they are not interchangeable, both have their own limitations. Maybe some modifications of this technique could be applied to gradient maps too.
hillsguy.bsky.social
Thanks!
I'm not familiar with WebGL, but considering that WebGL 2 is based on GLES 3, I think it should be mostly doable.
hillsguy.bsky.social
I also wanted to check out that famous bottle shader, but I don't think that I can pinpoint anything useful without looking at shaders.
All I see is that bottle is fully opaque and doesn't use any colors from the framebuffer. Looks like only cubemaps and per-pixel lighting are used for refractions.
hillsguy.bsky.social
The next one in the pipeline is water, but I've already covered it earlier.
Only after all of this the player viewmodel is rendered. CS2 has a separate pass for the viewmodel SSAO, which feels like overkill to me.
hillsguy.bsky.social
Two sets of buffers with different resolutions are used for smokes at different distances. Close ones are rendered in ¼ buffers, and distant ones in ½ buffers.
Fire is also rendered separately and merged with OIT later, but only 4 ½ res buffers are used.
hillsguy.bsky.social
Smoke is rendered separately in a bunch of low-res buffers and is combined with OIT buffers later.
A whopping SIX (!) buffers are used! (R 32F, RG 32F, RGBA 32F, RGBA 16F, RG 16F, R 8UI).
The first 4 buffers seem to be the same as the OIT buffers, but I'm not sure about the rest.
hillsguy.bsky.social
Two render passes and one final composing pass is used for transparent geometry (see moment-based OIT).

First pass uses 3 render buffers (R 32F, RG 32F, RGBA 32F).
Second pass uses previous data as input and renders color data in RGBA 16F buffer.
Final pass combines this data with framebuffer data.
hillsguy.bsky.social
CS2 also uses some flavor of order-independent transparency for particles, glass, smoke and fire. Most likely, moment-based OIT is used.
hillsguy.bsky.social
Decals are rendered after all solid geometry. Some flavor or parallax occlusion mapping is used (no fancy cone step mapping here). Textures are projected using data from z-buffer, which can cause artifacts when anti-aliasing is enabled.
hillsguy.bsky.social
AO is calculated in half-res RGB buffer.
Box is rendered around each dynamic object, with soft shadows from 3 directions stored as RGB. This data is then used in the main rendering pass, where the AO direction is selected based on the light direction from lightmap.
hillsguy.bsky.social
Z-Prepass is performed after shadow maps are rendered and is used as input for capsule-based (probably) AO.
hillsguy.bsky.social
CS2 uses parallax-corrected cubemaps as it's main method for reflections.

All cubemaps are stored in one large texture array. Pre-filtered mipmap are used for smooth rough reflections (looks really nice when used with roughness maps).
hillsguy.bsky.social
Light probe volumes are used to light dynamic objects.

Data is stored in two large 3D texture atlases. The first one is HDR and is six times bigger than other (looks like Valve is still using ambient cubes). The second one is LDR RGBA, looks like a shadow mask.
hillsguy.bsky.social
Shadow masks are used to combine shadow maps with dynamic props and players with baked penumbra shadows from static geometry. You also get per-pixel shading with proper normal mapping and specularity.

All shadow maps are rendered into one big atlas at the beginning of the frame.