Comments (4)
I don´t use fog rendering so this is just an idea.
I think you shouldn´t create the GBuffer0 by yourself.
At the DefferedGraphicsScreen sample the GBufferRenderer does it.
I can´t see that you use the GBufferRenderer so maybe this is the problem.
from digitalrune.
Please, help me . i am blocked since many days :'(
from digitalrune.
Hi, thank you so much for try to help me.I really appreciate that.
I try now your solution. And replace the code in my function
if (context.GBuffer0 == null)
{
........
}
By that new code
context.Data[RenderContextKeys.RebuildZBufferRenderer] = _rebuildZBufferRenderer;
_gBufferRenderer.Render(sceneQuery.RenderableNodes, sceneQuery.DecalNodes, context);
After this , if i start my game. I only can see a purple screen ^^. I think , i still need to change somethings.
By the way, i find the documentation not explain us to use the gBufferRenderer for render the fog.
I hope somebody have some idea
from digitalrune.
THank you !! I find now .
I just add that code more and everything goes well
// Render opaque meshes.
context.RenderTarget =
renderTargetPool.Obtain2D(new RenderTargetFormat(width, height, false, SurfaceFormat.HdrBlendable,
DepthFormat.Depth24Stencil8));
graphicsDevice.SetRenderTarget(context.RenderTarget);
context.Viewport = graphicsDevice.Viewport;
// Only copy the current render target to the final render target without post-processing.
graphicsDevice.SetRenderTarget(originalRenderTarget);
graphicsDevice.Viewport = originalViewport;
SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone);
SpriteBatch.Draw(context.SourceTexture, new Rectangle(0, 0, originalViewport.Width, originalViewport.Height), Color.White);
SpriteBatch.End();
context.RenderPass = null;
context.CameraNode = null;
context.LodCameraNode = null;
context.Scene = null;
context.LodHysteresis = 0;
renderTargetPool.Recycle(context.GBuffer0);
context.GBuffer0 = null;
renderTargetPool.Recycle(context.GBuffer1);
context.GBuffer1 = null;
renderTargetPool.Recycle((RenderTarget2D) context.Data[RenderContextKeys.DepthBufferHalf]);
context.Data.Remove(RenderContextKeys.DepthBufferHalf);
context.Data.Remove(RenderContextKeys.RebuildZBufferRenderer);
from digitalrune.
Related Issues (10)
- Confused about license
- How to use the compiled Release package (2016-3-10)? HOT 2
- Building errors HOT 6
- Is this thing Dead? HOT 1
- Build instructions are not complete/project cannot be build as-is HOT 7
- Problem load fbx model with DigitalRune HOT 2
- What kind of (Import) and (CPU) to use for loading models (FBX) on Universall App? HOT 2
- How to use instancing with [MeshInstancingNode]
- Under water effect HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digitalrune.