Page MenuHome

BGE: Add integer uniforms for 2D Filter
ClosedPublic

Authored by Thomas Szepe (hg1) on Jun 21 2015, 1:43 PM.

Details

Summary

Actually it is only possible to pass float properties to a 2D filter (GLSL fragment shader).
This patch allows also to use integer properties for the 2D filter.

Diff Detail

Repository
rB Blender

Event Timeline

This revision is now accepted and ready to land.Jun 21 2015, 1:51 PM
Jorge Bernal (lordloki) edited edge metadata.

Looks good to me

As usual, I'm not a fan of silently failing, which happens if the property is not found. However, the old code also silently failed, so I don't think that is a blocking issue for this patch.

What happens if you declare a float in the shader, but then use an integer property? Will there be a failure? If so, are we concerned about breaking existing projects?

source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
269

This is a minor nitpick, but I'd prefer to not declare variables in the middle of a scope. I also don't really see the point of storing the result of property->GetValueType() when we could do

switch (property->GetValueType()) {

And it still looks fine.

Thomas Szepe (hg1) edited edge metadata.

Changed switch (type) to switch (property->GetValueType()).

This revision was automatically updated to reflect the committed changes.