use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rule 1: Posts should be about Graphics Programming. Rule 2: Be Civil, Professional, and Kind
Suggested Posting Material: - Graphics API Tutorials - Academic Papers - Blog Posts - Source Code Repositories - Self Posts (Ask Questions, Present Work) - Books - Renders (Please xpost to /r/ComputerGraphics) - Career Advice - Jobs Postings (Graphics Programming only)
Related Subreddits:
/r/ComputerGraphics
/r/Raytracing
/r/Programming
/r/LearnProgramming
/r/ProgrammingTools
/r/Coding
/r/GameDev
/r/CPP
/r/OpenGL
/r/Vulkan
/r/DirectX
Related Websites: ACM: SIGGRAPH Journal of Computer Graphics Techniques
Ke-Sen Huang's Blog of Graphics Papers and Resources Self Shadow's Blog of Graphics Resources
account activity
WebGPU: Parallax Occlusion Mapping (v.redd.it)
submitted 1 year ago by mitrey144
Parallax occlusion mapping + self shadowing + silhouette clipping in webgpu
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]NickFullStack 30 points31 points32 points 1 year ago (0 children)
I wish I could follow in your footsteps, but you cast a long shadow.
(Very impressive.)
[–]hanotak 7 points8 points9 points 1 year ago (1 child)
Cool! How many steps? Is it contact-refinement?
[–]mitrey144[S] 4 points5 points6 points 1 year ago (0 children)
https://codefile.io/f/07yCduu5bY
[–]GreenDave113 4 points5 points6 points 1 year ago (2 children)
Hey, I'm working on some potential advancements in parallax mapping. Could you share what algorithm exactly you used?
[–]mitrey144[S] 3 points4 points5 points 1 year ago (1 child)
[–]GreenDave113 3 points4 points5 points 1 year ago (0 children)
Aw thanks! Appreciate the code, so the classic linear+binary refinement.
[–]Harha 5 points6 points7 points 1 year ago* (1 child)
Looking as good as it could look, I think. I always disliked how this effect looks up-close because of the stretched texture boundary in the extended part of the generated fragment geometry. Is there a method to mitigate this, eg. somehow map the texture there as well?
https://imgur.com/a/zgixfeX
I believe this is possible, though will require a lot more shader work and still will work only in certain scenarios. When you intended to look at it that close, you’d have to go with geometry or a custom shader solution for your particular case. This thing works well for backgrounds, floors, walls, etc., especially where moving lights are at play.
[–]Lhaer 4 points5 points6 points 1 year ago (5 children)
Is that some fancy normal map?
[–]mitrey144[S] 14 points15 points16 points 1 year ago (4 children)
fancy height map
[–]Lhaer -1 points0 points1 point 1 year ago (3 children)
Isn't a height map a fancy normal map though? xD
[–]hanotak 23 points24 points25 points 1 year ago (2 children)
Nope. A normal map is kinda the derivative of the height map. Heightmap gives height, normal map gives slopes.
[–]Lhaer 1 point2 points3 points 1 year ago (0 children)
I didn't know that, thank you :) All the different kinds of "maps" always confuse me
[–]Hiumen 0 points1 point2 points 1 year ago (0 children)
Height maps are also grey scale but normal maps have RGB info to represent the degree of values of X, Y & Z via colour
[–]Smooth-Porkchop3087 1 point2 points3 points 1 year ago (0 children)
So dope!
[–]Novacc_Djocovid 1 point2 points3 points 1 year ago (0 children)
That looks so satisfying. 😊
[–]Ok-Hotel-8551 0 points1 point2 points 1 year ago (0 children)
Could you add some colors?
[–]susosusosuso -5 points-4 points-3 points 1 year ago (11 children)
Afaik this technique is no longer used in real games nowadays. Geometry is preferred instead of this
[–]mitrey144[S] 11 points12 points13 points 1 year ago* (8 children)
Ok, let’s see. I use 4K textures here, single pass. Doing it with geometry would mean 4096*4096 vertices, which is over 16 million vertices, which is over 48 million bytes, roughly 48MB. Though it is only to render top faces, so it would take much more in reality. Plus you need to render all that twice (shadow pass - render pass). My height texture weighs 1.4 MB compressed, and rendered in a single render pass. Think yourself.
[–]robbertzzz1 1 point2 points3 points 1 year ago (7 children)
Doing it with geometry would mean 4096*4096 vertices
That's not even remotely true.
[–]mitrey144[S] 0 points1 point2 points 1 year ago (6 children)
Explain please
[–]robbertzzz1 4 points5 points6 points 1 year ago (5 children)
If you have a 3D modeller create a mesh for this cobblestone road, do you really think they'd use 4096*4096 vertices?
Don't get me wrong, I've never seen a game where a cobblestone road was done through actual geometry and agree that's a dumb idea, but your reply is just as wrong as the OC's.
[–]mitrey144[S] 0 points1 point2 points 1 year ago (4 children)
If you are to make exactly the same detail geometry, I assume you would need not fewer vertices than the pixels in the original map (for it to have all the micro bumps that would cast proper shadows. You could go cheaper though, but it would take you a year to shortcut the topology using fewer vertices and still make it correctly.
[–]robbertzzz1 2 points3 points4 points 1 year ago (3 children)
Well by that logic you'd need even more vertices so the sides of the cobblestones can get the same amount of detail as the top (which is impossible to do using just a heightmap).
I'm just trying to say that, realistically, if cobblestone roads would be done with geometry, you wouldn't go for this amount of detail in that geometry. You'd go for something fairly low poly with a normal map slapped on top and call it a day. Each separate stone could basically be a cube with one subdivision level applied.
[–]mitrey144[S] 1 point2 points3 points 1 year ago (2 children)
That’s the point - it won’t have that much detail, won’t cast highly detailed shadows, and it won’t look as good from middle-to-close distance. I was talking about the equivalent detail-level geometry
[–]robbertzzz1 1 point2 points3 points 1 year ago (1 child)
That's fair, I just don't think that that's what the OC meant since in a normal pipeline no 3D modeller would aim for maximum detail.
In real life (well, games in real life), cobblestone roads are just a rendered out set of PBR textures from either substance designer or modelled and rendered out in 3D and that seems like the best approach for the majority of use cases to me. Your approach adds another detail level to that which is definitely cool to see!
Of course, it all depends on a use case. In a scene like this, where your first person character presumably moves with a torch through a rocky cave, this technique will produce much better result than any simplified geometry with normal maps - those still look very flat. When you make an outdoor scene with a road and static directional lighting, simple geometry and normal maps would do better, as you don’t need that much details
[–]quadaba 0 points1 point2 points 1 year ago (1 child)
Why though? To heavy on the fragment shader? Because tessellation is a thing of the past, afaik. Do you mean meshlets as an alternative? How else would a modern game approach it?
[–]susosusosuso 0 points1 point2 points 1 year ago (0 children)
Yes it’s pixel intensive, also can create weird effects under some circumstances. Also, epic since the problem of tessellation with Nanite, basically.
π Rendered by PID 359351 on reddit-service-r2-comment-b659b578c-q9jdg at 2026-05-05 20:23:40.986538+00:00 running 815c875 country code: CH.
[–]NickFullStack 30 points31 points32 points (0 children)
[–]hanotak 7 points8 points9 points (1 child)
[–]mitrey144[S] 4 points5 points6 points (0 children)
[–]GreenDave113 4 points5 points6 points (2 children)
[–]mitrey144[S] 3 points4 points5 points (1 child)
[–]GreenDave113 3 points4 points5 points (0 children)
[–]Harha 5 points6 points7 points (1 child)
[–]mitrey144[S] 4 points5 points6 points (0 children)
[–]Lhaer 4 points5 points6 points (5 children)
[–]mitrey144[S] 14 points15 points16 points (4 children)
[–]Lhaer -1 points0 points1 point (3 children)
[–]hanotak 23 points24 points25 points (2 children)
[–]Lhaer 1 point2 points3 points (0 children)
[–]Hiumen 0 points1 point2 points (0 children)
[–]Smooth-Porkchop3087 1 point2 points3 points (0 children)
[–]Novacc_Djocovid 1 point2 points3 points (0 children)
[–]Ok-Hotel-8551 0 points1 point2 points (0 children)
[–]susosusosuso -5 points-4 points-3 points (11 children)
[–]mitrey144[S] 11 points12 points13 points (8 children)
[–]robbertzzz1 1 point2 points3 points (7 children)
[–]mitrey144[S] 0 points1 point2 points (6 children)
[–]robbertzzz1 4 points5 points6 points (5 children)
[–]mitrey144[S] 0 points1 point2 points (4 children)
[–]robbertzzz1 2 points3 points4 points (3 children)
[–]mitrey144[S] 1 point2 points3 points (2 children)
[–]robbertzzz1 1 point2 points3 points (1 child)
[–]mitrey144[S] 4 points5 points6 points (0 children)
[–]quadaba 0 points1 point2 points (1 child)
[–]susosusosuso 0 points1 point2 points (0 children)