| 433 | } |
| 434 | |
| 435 | void SpriteBlur::initProgram() |
| 436 | { |
| 437 | auto program = ProgramManager::getInstance()->loadProgram(positionTextureColor_vert, "custom/example_Blur_fs", VertexLayoutType::Sprite); |
| 438 | auto programState = new backend::ProgramState(program); |
| 439 | setProgramState(programState); |
| 440 | AX_SAFE_RELEASE(programState); |
| 441 | |
| 442 | auto size = getTexture()->getContentSizeInPixels(); |
| 443 | |
| 444 | SET_UNIFORM(_programState, "resolution", size); |
| 445 | SET_UNIFORM(_programState, "blurRadius", _blurRadius); |
| 446 | SET_UNIFORM(_programState, "sampleNum", 7.0f); |
| 447 | SET_UNIFORM(_programState, "u_PMatrix", |
| 448 | Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION)); |
| 449 | } |
| 450 | |
| 451 | void SpriteBlur::setBlurRadius(float radius) |
| 452 | { |
nothing calls this directly
no test coverage detected