mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 01:03:38 +02:00
Fade seems to be working on shape items with instanced drawing.
This commit is contained in:
parent
3316be4dea
commit
abc751ef9c
3 changed files with 6 additions and 4 deletions
|
@ -112,6 +112,7 @@ bool RenderableShapeEntityItem::addToScene(const EntityItemPointer& self, const
|
|||
renderPayload->addStatusGetters(statusGetters);
|
||||
|
||||
transaction.resetItem(_myItem, renderPayload);
|
||||
transaction.addTransitionToItem(_myItem, render::Transition::ELEMENT_ENTER_DOMAIN);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ void FadeEffect::packToAttributes(const int category, const float threshold, con
|
|||
packedData1.x = noiseOffset.x;
|
||||
packedData1.y = noiseOffset.y;
|
||||
packedData1.z = noiseOffset.z;
|
||||
packedData1.w = (float)category;
|
||||
packedData1.w = (float)(category+0.1f); // GLSL hack so that casting back from float to int in fragment shader returns the correct value.
|
||||
|
||||
packedData2.x = baseOffset.x;
|
||||
packedData2.y = baseOffset.y;
|
||||
|
|
|
@ -94,12 +94,13 @@ render::ItemID FadeEditJob::findNearestItem(const render::RenderContextPointer&
|
|||
glm::vec3 normal;
|
||||
float isectDistance;
|
||||
render::ItemID nearestItem = render::Item::INVALID_ITEM_ID;
|
||||
const float minDistance = 2.f;
|
||||
const float minDistance = 1.f;
|
||||
const float maxDistance = 50.f;
|
||||
|
||||
for (const auto& itemBound : inputs) {
|
||||
if (!itemBound.bound.contains(rayOrigin) && itemBound.bound.findRayIntersection(rayOrigin, rayDirection, isectDistance, face, normal)) {
|
||||
auto& item = renderContext->_scene->getItem(itemBound.id);
|
||||
if (item.getKey().isWorldSpace() && isectDistance>minDistance && isectDistance < minIsectDistance) {
|
||||
if (item.getKey().isWorldSpace() && isectDistance>minDistance && isectDistance < minIsectDistance && isectDistance<maxDistance) {
|
||||
nearestItem = itemBound.id;
|
||||
minIsectDistance = isectDistance;
|
||||
}
|
||||
|
@ -148,7 +149,7 @@ FadeConfig::FadeConfig()
|
|||
|
||||
events[FADE_USER_ENTER_LEAVE_DOMAIN].noiseSize = glm::vec3{ 10.f, 0.01f, 10.0f };
|
||||
events[FADE_USER_ENTER_LEAVE_DOMAIN].noiseLevel = 0.3f;
|
||||
events[FADE_USER_ENTER_LEAVE_DOMAIN].noiseSpeed = glm::vec3{ 0.0f, -0.5f, 0.0f };
|
||||
events[FADE_USER_ENTER_LEAVE_DOMAIN].noiseSpeed = glm::vec3{ 0.0f, -5.0f, 0.0f };
|
||||
events[FADE_USER_ENTER_LEAVE_DOMAIN].timing = FadeConfig::LINEAR;
|
||||
events[FADE_USER_ENTER_LEAVE_DOMAIN].baseSize = glm::vec3{ 10000.f, 1.0f, 10000.0f };
|
||||
events[FADE_USER_ENTER_LEAVE_DOMAIN].baseLevel = 1.f;
|
||||
|
|
Loading…
Reference in a new issue