Before I get slammed I've scoured the Internet and have tried implementing the various shaders I've found some don't work at all and others strange results occur.
Some where straight out of render monkey with the weights provided in the shader and I could not get it to work properly, no shader compile errors either.
I fear it may be due to the screenquad node as I found a topic here about it.
Anyone mind posting there working gaussian blur shader?
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Anyone mind posting there working gaussian blur shader?
Let me state that I have some working blur shaders I'm just not so sure there Gaussian Blur shaders as when I use Gaussian filter in Photoshop as a test on an image it looks better.
Re: Anyone mind posting there working gaussian blur shader?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Anyone mind posting there working gaussian blur shader?
Thanks entity I have a gaussian blur shader similar to yours weights are provided in the shader but it never worked properly. I'll convert yours to hlsl.
Thanks Glitch.
Thanks Glitch.
Re: Anyone mind posting there working gaussian blur shader?
hlsl have that weird 0.5 pixel offset thing..
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Anyone mind posting there working gaussian blur shader?
@ REDDEMON
What do you mean?
What do you mean?
Re: Anyone mind posting there working gaussian blur shader?
@The_Glitch
You can find more info here:
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
In D3D10+ you don't need any offsets, this "feature" is only related to D3D9.
You can find more info here:
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
In D3D10+ you don't need any offsets, this "feature" is only related to D3D9.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Anyone mind posting there working gaussian blur shader?
Yeah I think I read this in the past.
I thought the ScreenQuad Node handled this automatically. I could be wrong though.
In funtction below shiftx and shifty is this not what these lines are doing?
I thought the ScreenQuad Node handled this automatically. I could be wrong though.
In funtction below shiftx and shifty is this not what these lines are doing?
Code: Select all
CScreenQuadSceneNode::CScreenQuadSceneNode(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id) :ISceneNode(parent, mgr, id), hardwareBuffer(false)
{
f32 shiftX, shiftY;
core::dimension2d<u32> currentResolution;
/** Here we initialize the vertices of the screen Aligned quad */
currentResolution = mgr->getVideoDriver()->getScreenSize();
aabb.reset(0, 0, 0);
shiftX = 0.5f / currentResolution.Width; //This small shift is necessary to compensate the texture sampling bias // This line Here
shiftY = 0.5f / currentResolution.Height; //It avoids that our effect becomes too blurry. // This Line Here
indexBuffer = new scene::CIndexBuffer(); // ";" is missing in my orig code.
indexBuffer->addIndex(0); //0
indexBuffer->addIndex(1);//1
indexBuffer->addIndex(2);//2
indexBuffer->addIndex(1);//1
indexBuffer->addIndex(3);//3
indexBuffer->addIndex(2);//2
video::S3DVertex2TCoords vertices[4];
vertices[0] = video::S3DVertex2TCoords(-1.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f, video::SColor(255, 255, 255, 255), shiftX, shiftY, shiftX, shiftY);
vertices[1] = video::S3DVertex2TCoords(1.0f, -1.0, 0.0f, 0.0f, 0.0f, -1.0f, video::SColor(255, 255, 255, 255), 1.0f + shiftX, shiftY, 1.0f + shiftX, shiftY);
vertices[2] = video::S3DVertex2TCoords(-1.0f, 1.0, 0.0f, 0.0f, 0.0f, -1.0f, video::SColor(255, 255, 255, 255), shiftX, 1.0f + shiftY, shiftX, 1.0f + shiftY);
vertices[3] = video::S3DVertex2TCoords(1.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, video::SColor(255, 255, 255, 255), 1.0f + shiftX, 1.0f + shiftY, 1.0f + shiftX, 1.0f + shiftY);
// vertex descriptor no. 1 is for S3DVertex2TCoords
vertexBuffer = new scene::CVertexBuffer<video::S3DVertex2TCoords>(mgr->getVideoDriver()->getVertexDescriptor(1));
vertexBuffer->addVertex(vertices[0]);
vertexBuffer->addVertex(vertices[1]);
vertexBuffer->addVertex(vertices[2]);
vertexBuffer->addVertex(vertices[3]);
/** Now we proceed to initialize the appropriate settings for the material we are going to use
We can alter these later, but for the time being, initializing them here will do no harm */
material.Lighting = false; //No need for lighting.
material.BackfaceCulling = false; //not needed, but simplifies things
material.MaterialType = video::EMT_LIGHTMAP_ADD;
setAutomaticCulling(scene::EAC_OFF); //We don't need this scene node to be culled because we render it in screen space.
material.ZBuffer = video::ECFN_ALWAYS;
material.ZWriteEnable = false;
for (u32 i = 0; i < _IRR_MATERIAL_MAX_TEXTURES_; ++i)
{
material.TextureLayer[i].TextureWrapU = irr::video::ETC_CLAMP;
material.TextureLayer[i].TextureWrapV = irr::video::ETC_CLAMP;
}
}