After a little experimentation.. proof of concept for form-fitting vehicle shields. Incredibly cheap even with 100+ vehicles, 64+ impacts each. Each shield utilizes a 1x64 16-bit HDR texture (~4kb) - super fast!
@UnrealEngine #UE4 #ScreenshotSundaypic.twitter.com/aMo2qkT1gC
-
Pokaż ten wątek
-
W odpowiedzi do @_Jambax @UnrealEngine
It looks like a great idea. I guess the texture keeps local locations of impacts. But how do you use it as mask to render that impact texture? Masking would be low res and looping through them on hlsl is more expensive.
1 odpowiedź 0 podanych dalej 0 polubionych -
W odpowiedzi do @ErgenSerhat @UnrealEngine
Yeah, it loops through each pixel in the LUT, and accumulates the falloff. It's an alternative to having a full-size render target and unique UV's for the object, which has limited resolution and removes x-amount of calls to DrawMaterialToRenderTarger (which is crazy slow)
1 odpowiedź 0 podanych dalej 0 polubionych -
W odpowiedzi do @_Jambax @UnrealEngine
Thanks a lot for the explanation. Yeah, it should be way performant compared to rtt probably on any situation where you draw same texture multiple times. Great idea!
1 odpowiedź 0 podanych dalej 1 polubiony -
W odpowiedzi do @ErgenSerhat @UnrealEngine
I don't think you'll see a perf impact from looping in hlsl here because the branch isn't going to be non-divergent across the pixel group processed by the gpu. I think there's cheaper ways to do this though like splitting into a grid of possible impacts and picking the closest
1 odpowiedź 0 podanych dalej 1 polubiony -
is going to be non-divergent* oops! Basically it's going to be the same for every pixel (as long as you keep it that way) so each pixel can be executed in parallel
Could be something unforseen though so I'd check in renderdoc1 odpowiedź 0 podanych dalej 1 polubiony -
There's definitely room for improvement for sure, it's a very basic implementation at the moment. The major downside is I have to do 90% of the work inside the loop body, so as the effect gets more complex/interesting the cost starts to skyrocket.
3 odpowiedzi 0 podanych dalej 1 polubiony -
Are you generating a distance (sqr) field to drive the effect? That's how I'd do it, but splitting it into cells (look at worley noise algorithms) could reduce a lot of the complexity at the cost of precise hits
1 odpowiedź 0 podanych dalej 0 polubionych -
Yeah so the loop essentially loops through the LUT texture and accumulates `distance(PixelPos, LUT.rgb) * LUT.a;` - eventually I plan to add a second column of pixels to provide the radius as well (think higher damage = larger effect)
1 odpowiedź 0 podanych dalej 0 polubionych -
W odpowiedzi do to @_Jambax@calvinatorr i jeszcze
I spent a hella-lot of time trying to work out if I could bake a data texture or pack info into the UV's to avoid the loop, but came up short on that idea everytime.. not sure there is a solution that doesn't involve at least some looping.
2 odpowiedzi 0 podanych dalej 0 polubionych
The option I'd use to remove the looping though is to store the data in a buffer/3d LUT of essentially cells, then you can use the local pixelpos to map that back to your buffer/LUT to get the data you need
Wydaje się, że ładowanie zajmuje dużo czasu.
Twitter jest przeciążony lub wystąpił chwilowy problem. Spróbuj ponownie lub sprawdź status Twittera, aby uzyskać więcej informacji.