291 m_texture3DuniformValue = program()->uniformLocation(
"myTexture3D");
292 m_eyePositionUniformLocation = program()->uniformLocation(
"ve_eyePosition");
301 GLuint *
data = parent.data()->texture3Ddata().data;
302 GLuint w = parent.data()->texture3Ddata().width;
303 GLuint h = parent.data()->texture3Ddata().height;
304 GLuint d = parent.data()->texture3Ddata().depth;
307 glGenTextures(1, &g_volTexObj);
309 glBindTexture(GL_TEXTURE_3D, g_volTexObj);
310 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
311 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
312 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
313 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
314 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
316 glPixelStorei(GL_UNPACK_ALIGNMENT,1);
317 glTexImage3D(GL_TEXTURE_3D, 0, GL_INTENSITY, w, h, d, 0, GL_LUMINANCE, GL_UNSIGNED_INT, data);
319 program()->setUniformValue(m_texture3DuniformValue, g_volTexObj);
322 propertyIdsToUniformLocations.clear();
323 uniformLocationsToTextureUnits.clear();
325 propertyListener->disconnect();
326 if (parent.data() == 0)
330 QObject::connect(propertyListener, SIGNAL(propertyChanged()), parent.data(), SIGNAL(effectChanged()));
332 const QMetaObject* parentMetaObject = parent.data()->metaObject();
333 int parentMethodCount = parentMetaObject->methodCount();
335 for (
int i = parentMetaObject->propertyOffset();
336 i < parentMetaObject->propertyCount(); i++)
338 QMetaProperty metaProperty = parentMetaObject->property(i);
339 QByteArray propertyName = metaProperty.name();
340 int location = program()->uniformLocation(propertyName);
345 dirtyProperties.append(i);
346 propertyIdsToUniformLocations[i] = location;
347 if (metaProperty.hasNotifySignal())
349 QMetaMethod notifySignal = metaProperty.notifySignal();
351 int signalIndex = notifySignal.methodIndex();
361 QMetaObject::connect(parent.data(), signalIndex,
362 propertyListener, parentMethodCount + i);
364 qWarning() <<
"Warning: No notification signal found for property: " << propertyName;
365 propertiesWithoutNotificationSignal.append(i);