mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-15 08:39:43 +00:00
Merge branch 'master' into 'bigpeepeventsenergy'
# Conflicts: # components/sdlutil/sdlinputwrapper.cpp
This commit is contained in:
commit
04fcfcc79d
6 changed files with 62 additions and 7 deletions
|
@ -15,6 +15,7 @@
|
|||
Bug #3905: Great House Dagoth issues
|
||||
Bug #4203: Resurrecting an actor doesn't close the loot GUI
|
||||
Bug #4227: Spellcasting restrictions are checked before spellcasting animations are played
|
||||
Bug #4374: Player rotation reset when nearing area that hasn't been loaded yet
|
||||
Bug #4376: Moved actors don't respawn in their original cells
|
||||
Bug #4389: NPC's lips do not move if his head model has the NiBSAnimationNode root node
|
||||
Bug #4602: Robert's Bodies: crash inside createInstance()
|
||||
|
@ -118,6 +119,7 @@
|
|||
Bug #6519: Effects tooltips for ingredients work incorrectly
|
||||
Bug #6523: Disintegrate Weapon is resisted by Resist Magicka instead of Sanctuary
|
||||
Bug #6544: Far from world origin objects jitter when camera is still
|
||||
Bug #6545: Player character momentum is preserved when going to a different cell
|
||||
Bug #6559: Weapon condition inconsistency between melee and ranged critical / sneak / KO attacks
|
||||
Bug #6579: OpenMW compilation error when using OSG doubles for BoundingSphere
|
||||
Bug #6606: Quests with multiple IDs cannot always be restarted
|
||||
|
|
|
@ -699,7 +699,10 @@ namespace MWPhysics
|
|||
void PhysicsSystem::clearQueuedMovement()
|
||||
{
|
||||
for (const auto& [_, actor] : mActors)
|
||||
{
|
||||
actor->setVelocity(osg::Vec3f());
|
||||
actor->setInertialForce(osg::Vec3f());
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Simulation> PhysicsSystem::prepareSimulation(bool willSimulate)
|
||||
|
|
|
@ -51,6 +51,22 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
class MarkDrawablesVisitor : public osg::NodeVisitor
|
||||
{
|
||||
public:
|
||||
MarkDrawablesVisitor(osg::Node::NodeMask mask)
|
||||
: osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
|
||||
, mMask(mask)
|
||||
{ }
|
||||
|
||||
void apply(osg::Drawable& drawable) override
|
||||
{
|
||||
drawable.setNodeMask(mMask);
|
||||
}
|
||||
|
||||
private:
|
||||
osg::Node::NodeMask mMask = 0;
|
||||
};
|
||||
|
||||
/// Removes all particle systems and related nodes in a subgraph.
|
||||
class RemoveParticlesVisitor : public osg::NodeVisitor
|
||||
|
@ -1555,6 +1571,9 @@ namespace MWRender
|
|||
|
||||
node->setNodeMask(Mask_Effect);
|
||||
|
||||
MarkDrawablesVisitor markVisitor(Mask_Effect);
|
||||
node->accept(markVisitor);
|
||||
|
||||
params.mMaxControllerLength = findMaxLengthVisitor.getMaxLength();
|
||||
params.mLoop = loop;
|
||||
params.mEffectId = effectId;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#include <osg/BlendFunc>
|
||||
#include <osg/Texture2D>
|
||||
#include <osg/Texture2DArray>
|
||||
#include <osg/Material>
|
||||
#include <osg/AlphaFunc>
|
||||
|
||||
#include <osgUtil/RenderStage>
|
||||
|
||||
|
@ -10,6 +12,8 @@
|
|||
#include <components/stereo/multiview.hpp>
|
||||
#include <components/stereo/stereomanager.hpp>
|
||||
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
TransparentDepthBinCallback::TransparentDepthBinCallback(Shader::ShaderManager& shaderManager, bool postPass)
|
||||
|
@ -34,6 +38,7 @@ namespace MWRender
|
|||
|
||||
mStateSet->setAttributeAndModes(new osg::BlendFunc, modeOff);
|
||||
mStateSet->setAttributeAndModes(shaderManager.getProgram(vertex, fragment), modeOn);
|
||||
mStateSet->setAttributeAndModes(new SceneUtil::AutoDepth, modeOn);
|
||||
|
||||
for (unsigned int unit = 1; unit < 8; ++unit)
|
||||
mStateSet->setTextureMode(unit, GL_TEXTURE_2D, modeOff);
|
||||
|
@ -88,11 +93,35 @@ namespace MWRender
|
|||
|
||||
opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);
|
||||
|
||||
osg::ref_ptr<osg::StateSet> restore = bin->getStateSet();
|
||||
bin->setStateSet(mStateSet);
|
||||
// draws transparent post-pass to populate a postprocess friendly depth texture with alpha-clipped geometry
|
||||
bin->drawImplementation(renderInfo, previous);
|
||||
bin->setStateSet(restore);
|
||||
// draw transparent post-pass to populate a postprocess friendly depth texture with alpha-clipped geometry
|
||||
|
||||
unsigned int numToPop = previous ? osgUtil::StateGraph::numToPop(previous->_parent) : 0;
|
||||
if (numToPop > 1)
|
||||
numToPop--;
|
||||
unsigned int insertStateSetPosition = state.getStateSetStackSize() - numToPop;
|
||||
|
||||
state.insertStateSet(insertStateSetPosition, mStateSet);
|
||||
for(auto rit = bin->getRenderLeafList().begin(); rit != bin->getRenderLeafList().end(); rit++)
|
||||
{
|
||||
osgUtil::RenderLeaf* rl = *rit;
|
||||
const osg::StateSet* ss = rl->_parent->getStateSet();
|
||||
|
||||
if (rl->_drawable->getNodeMask() == Mask_ParticleSystem || rl->_drawable->getNodeMask() == Mask_Effect)
|
||||
continue;
|
||||
|
||||
if (ss->getAttribute(osg::StateAttribute::ALPHAFUNC))
|
||||
continue;
|
||||
|
||||
if (ss->getAttribute(osg::StateAttribute::MATERIAL)) {
|
||||
const osg::Material* mat = static_cast<const osg::Material*>(ss->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
if (mat->getDiffuse(osg::Material::FRONT).a() < 0.5)
|
||||
continue;
|
||||
}
|
||||
|
||||
rl->render(renderInfo,previous);
|
||||
previous = rl;
|
||||
}
|
||||
state.removeStateSet(insertStateSetPosition);
|
||||
|
||||
msaaFbo ? msaaFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER) : fbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);
|
||||
state.checkGLErrors("after TransparentDepthBinCallback::drawImplementation");
|
||||
|
|
|
@ -52,13 +52,15 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> v
|
|||
|
||||
if (windowEventsOnly)
|
||||
{
|
||||
// During loading, handle window events, discard button presses and keep others for later
|
||||
// During loading, handle window events, discard button presses and mouse movement and keep others for later
|
||||
while (SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_WINDOWEVENT, SDL_WINDOWEVENT) > 0)
|
||||
handleWindowEvent(evt);
|
||||
|
||||
SDL_FlushEvent(SDL_KEYDOWN);
|
||||
SDL_FlushEvent(SDL_CONTROLLERBUTTONDOWN);
|
||||
SDL_FlushEvent(SDL_MOUSEBUTTONDOWN);
|
||||
SDL_FlushEvent(SDL_MOUSEMOTION);
|
||||
SDL_FlushEvent(SDL_MOUSEWHEEL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ void main()
|
|||
{
|
||||
float alpha = texture2D(diffuseMap, diffuseMapUV).a * alphaPassthrough;
|
||||
|
||||
const float alphaRef = 0.5;
|
||||
const float alphaRef = 0.499;
|
||||
|
||||
if (alpha < alphaRef)
|
||||
discard;
|
||||
|
|
Loading…
Reference in a new issue