Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
After purchasing the source code for my game Trepidation (and thus forked CopperCube runtime into my own thing), I discovered the realtime shadow code had some issues. Shadows were quite disconnected from their corresponding models, and the low-res distant shadow map was refreshing with every frame draw, thus parsing all scene nodes within the render area per frame. I went ahead and re-wrote most of it, keeping only the near vs far map distinction. The near map renders at up to 4096x4096 (500 units around the player, all realtime shadows + foliage and PCF filtered), while the far map is 2048x2048 (2,600-3,000 units around player). The far map uses some player camera heuristics to decide when to refresh the far map, up to once every 2.4 seconds. The downside with this approach is sudden camera moves can incorrectly light distant geometry when paired with LOD, but I've found it worthwhile. My implementation runs better than the original code in my testing. I'll probably release or document my changes in more detail when I have time. I also slapped together a video showcase: https://www.youtube.com/watch?v=... |
||||
|
Wow cool great job, keep us updated! |
||||
|
Any chance to get these shadows working with OpenGL CopperCube? |
||||
|
guest_guest wrote: Any chance to get these shadows working with OpenGL CopperCube? Unfortunately, no. This required modifying the win32 engine binary. Coppercube studio edition only provides the source code to Windows & Android targets. On OpenGL you could theoretically inject new shading into the browser context, but that would be difficult if not impossible to get working well. |
||||
|
Good job studiorewired, will you share the binary file? Or is it private? |
||||
|
I think you misunderstood @studiorewired, I was asking about CopperCube win32 publishing target with OpenGL instead of win32 DirectX render pipeline (no webGL involved at all) |
||||
|
guest_guest wrote: I think you misunderstood @studiorewired, I was asking about CopperCube win32 publishing target with OpenGL instead of win32 DirectX render pipeline (no webGL involved at all) Oops lol. I forget there's an alternative to DirectX for windows target / that the web target uses WebGL, not OpenGL. Neither are something I've used in my year-and-a-half working with CopperCube. Unfortunately, my realtime shadow code only supports DirectX. Just to see what would happen, I tried compiling it for OpenGL and it runs but it doesn't render lighting. |
||||
|
Monks wrote: Good job studiorewired, will you share the binary file? Or is it private? I wasn't going to release it until I had a bundle of CopperCube tools ready to give to the community. But I also don't wanna gatekeep so here you go: https://studiorewired.itch.io/co... |
||||
|
Thank you very much @studiorewired for sharing! |
||||
|
Nice work - Ive not touched the existing shadows in Coppercube as this replaces all fixed function materials and lighting. Might be worth it for outdoor terrains even still as you dont need many outdoor lights typically - its mainly an indoor thing. I'd be happy to try out your new shadow code if you want to make the source public - seems like a nice upgrade actually. I'd be keen to test out your terrain LOD thing also and compare to the occlusion culling system I added from Irrlicht engine and see which is better overall.... up to you but would interested to see as good terrain performance has been a big thing for me also.. |
||||
|
|