New answers tagged

0

The question asks about branch avoidance, so doing that while retaining comparison is still fair play(*). Checking if some scalar or vector equals its clamped version is a terse, intuitive option: Combine float(clampN(d, dMin, dMax) == d), which yields 0.0 if false or 1.0 if true, with whatever way you use this resulting value, for example, mix. d can be ...


1

Turns out it had to do with the V vector working differently in deferred rendering than it does in forward rendering, something that I overlooked and seems obvious now. Specifically, I passed the view direction calculated in the camera class to the lighting pass fragment shader then negated it like so vec3 V = normalize(-(cameraPosition - v_pos));. Things ...


2

When creating a OpenGL context you have to specify a profile mask, which is a way of telling the driver whether you want to use compatibility ("legacy") features or not. Drivers are required to implement all core profile features, but compatibility profile is optional - creating a compatibility context can fail even if the driver supports the version you've ...


Top 50 recent answers are included