-
-
W odpowiedzi do @Luos_83
Wait, is it that bad to use? i use it way to much
1 odpowiedź 0 podanych dalej 0 polubionych -
W odpowiedzi do @DeLaetMilan
they should be used cautiously, but Ue4 handles them quite well.
@JKashaar (or any other amazing tech-person) can probably explain it better than I ever could though.2 odpowiedzi 0 podanych dalej 1 polubiony -
W odpowiedzi do @Luos_83 @DeLaetMilan
These days they're generally not a problem, just be aware that normally both inputs of the If get executed, so it's kind of more like a hard Lerp and doesn't save you any performance costs.
1 odpowiedź 0 podanych dalej 4 polubione -
Somehow this topic always brings out the heavy debates, would branching where the conditional is the same across the entire drawcall be more performant than a lerp? my understanding was that If-s are mainly bad if the conditional evaluates differently within a 2x2 quadrant
1 odpowiedź 0 podanych dalej 1 polubiony -
Yes you're right. Dynamic branching incurs a performance cost if the conditional diverges across the pixel group (because the GPU processes multiple pixels in parallel). So if you use it essentially as a switch, it'll be fine.
2 odpowiedzi 0 podanych dalej 3 polubione -
W odpowiedzi do to @calvinatorr@JKashaar i jeszcze
Alright, glad that stuck with me then
It seems to be a pretty finicky topic based on previous posts I've seen (Maybe cause the severity differs among engines?), it gets hard to gauge which one's correct sometimes2 odpowiedzi 0 podanych dalej 1 polubiony -
The severity doesn't change with engines really, it's down to the graphics API if anything and how it handles branching. i.e. OpenGL doesn't handle branching well apparently
Also porting - on PS4 HLSL gets ported to PSGL, so how that handles branching might differ slightly?
1 odpowiedź 0 podanych dalej 1 polubiony -
W odpowiedzi do to @calvinatorr@JKashaar i jeszcze
I recall some of the arguments against branching were made in the context of Shadertoy, so OpenGL not handling it well does connect the dots there
In that case I suppose that's something I should keep in the back of my head when working on different platforms1 odpowiedź 0 podanych dalej 0 polubionych
In Unreal usually you should just allow it to decide for you, the HLSL compiler/assembler is smart, and the generated HLSL will be further optimised than you realise 
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.