------------------------------------------------------------------------------
| 212 | |
| 213 | //------------------------------------------------------------------------------ |
| 214 | void vtkOpenGLStickMapper::SetCameraShaderParameters( |
| 215 | vtkOpenGLHelper& cellBO, vtkRenderer* ren, vtkActor* actor) |
| 216 | { |
| 217 | vtkShaderProgram* program = cellBO.Program; |
| 218 | |
| 219 | vtkOpenGLCamera* cam = (vtkOpenGLCamera*)(ren->GetActiveCamera()); |
| 220 | |
| 221 | vtkMatrix4x4* wcdc; |
| 222 | vtkMatrix4x4* wcvc; |
| 223 | vtkMatrix3x3* norms; |
| 224 | vtkMatrix4x4* vcdc; |
| 225 | cam->GetKeyMatrices(ren, wcvc, norms, vcdc, wcdc); |
| 226 | |
| 227 | if (program->IsUniformUsed("VCDCMatrix")) |
| 228 | { |
| 229 | program->SetUniformMatrix("VCDCMatrix", vcdc); |
| 230 | } |
| 231 | |
| 232 | if (!actor->GetIsIdentity()) |
| 233 | { |
| 234 | vtkMatrix4x4* mcwc; |
| 235 | vtkMatrix3x3* anorms; |
| 236 | ((vtkOpenGLActor*)actor)->GetKeyMatrices(mcwc, anorms); |
| 237 | if (program->IsUniformUsed("MCVCMatrix")) |
| 238 | { |
| 239 | vtkMatrix4x4::Multiply4x4(mcwc, wcvc, this->TempMatrix4); |
| 240 | program->SetUniformMatrix("MCVCMatrix", this->TempMatrix4); |
| 241 | } |
| 242 | if (program->IsUniformUsed("normalMatrix")) |
| 243 | { |
| 244 | vtkMatrix3x3::Multiply3x3(anorms, norms, this->TempMatrix3); |
| 245 | program->SetUniformMatrix("normalMatrix", this->TempMatrix3); |
| 246 | } |
| 247 | } |
| 248 | else |
| 249 | { |
| 250 | if (program->IsUniformUsed("MCVCMatrix")) |
| 251 | { |
| 252 | program->SetUniformMatrix("MCVCMatrix", wcvc); |
| 253 | } |
| 254 | if (program->IsUniformUsed("normalMatrix")) |
| 255 | { |
| 256 | program->SetUniformMatrix("normalMatrix", norms); |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | if (program->IsUniformUsed("cameraParallel")) |
| 261 | { |
| 262 | cellBO.Program->SetUniformi("cameraParallel", cam->GetParallelProjection()); |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | //------------------------------------------------------------------------------ |
| 267 | void vtkOpenGLStickMapper::SetMapperShaderParameters( |
no test coverage detected