Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualGavin Williams

Posted 09 December 2012 - 11:48 PM

Ok, I didn't know that, thanks. So i set the compiler flag ...

ShaderBytecode shaderByteCode = ShaderBytecode.CompileFromFile(
"Walls/effect_Walls.fx",
"fx_5_0",
ShaderFlags.EnableStrictness | ShaderFlags.Debug | ShaderFlags.OptimizationLevel0 | ShaderFlags.PackMatrixRowMajor,
EffectFlags.None);

But still nothing.

Edit : I'm removing the effects framework code just to make sure it's not hiding some mismatched binding or something.

Edit 2 : Here's the updated render code, having removed the effects framework ... but still nothing :

/// <summary>
	    public void RenderToGBuffer(Viewport viewport, ICamera camera, Map map)
	    {
		    DeviceContext context = SlimDXGraphics.Device11.ImmediateContext;

		    // configure input assembler ----------------------------------------------------------
		    context.InputAssembler.InputLayout = layout;
		    context.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList;
		    // set the shaders
		    context.VertexShader.Set(vertexShader);
		    context.PixelShader.Set(pixelShader);

		    // configure rasterizer ---------------------------------------------------------------
		    context.Rasterizer.SetViewports(viewport);
		    context.Rasterizer.State = SlimDXGraphics.RasterState_Solid;
 
		    context.OutputMerger.BlendState = SlimDXGraphics.BlendState_Transparent;
		    foreach (Chunk chunk in map.VisibleChunks)
		    {
			    foreach (KeyValuePair<int, List<Point>> kVPair in chunk.wallInstanceCollectionsDictionary)
			    {
				    // configure input assembler specific to the wall segment shape
				    context.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(map.wall000.VertexBuffer, VertexPCNT.SizeInBytes, 0));
				   
				    foreach (Point p in kVPair.Value)
				    {
					    // set shader variables specific for each wall section (this will be unnecessary with instancing)
					    // and even without it, the view & proj matrices need only be set for the entire world view frame render pass
					    cBufferStruct.mProj = camera.ProjMatrix;
					    cBufferStruct.mView = camera.ViewMatrix;
					    cBufferStruct.mWorld = Matrix.Translation(new Vector3(p.X, p.Y, 0));
					   
					    using (DataStream data = new DataStream(CBufferStruct.SizeInBytes, true, true))
					    {
						    data.Position = 0;
						    data.Write(cBufferStruct);
						    context.UpdateSubresource(new DataBox(0, 0, data), cBuffer, 0);
						    data.Dispose();
					    }
					    // now bind the constant buffer to the pipeline
					    context.VertexShader.SetConstantBuffer(cBuffer, 0);
 
					    context.PixelShader.SetShaderResource(map.SRVWallTexture, 0);
 
					    // draw -------------------------------------------------------------------------------
					    if (map.wall000.IndexCount == 0)
						    context.Draw(map.wall000.VertexCount, 0);
					    else
						    context.DrawIndexed(map.wall000.IndexCount, 0, 0);
				    }
			    }
		    }

#2Gavin Williams

Posted 09 December 2012 - 11:07 PM

Ok, I didn't know that, thanks. So i set the compiler flag ...

ShaderBytecode shaderByteCode = ShaderBytecode.CompileFromFile(
"Walls/effect_Walls.fx",
"fx_5_0",
ShaderFlags.EnableStrictness | ShaderFlags.Debug | ShaderFlags.OptimizationLevel0 | ShaderFlags.PackMatrixRowMajor,
EffectFlags.None);

But still nothing.

Edit : I'm removing the effects framework code just to make sure it's not hiding some mismatched binding or something.

#1Gavin Williams

Posted 09 December 2012 - 10:27 PM

Ok, I didn't know that, thanks. So i set the compiler flag ...

ShaderBytecode shaderByteCode = ShaderBytecode.CompileFromFile(
"Walls/effect_Walls.fx",
"fx_5_0",
ShaderFlags.EnableStrictness | ShaderFlags.Debug | ShaderFlags.OptimizationLevel0 | ShaderFlags.PackMatrixRowMajor,
EffectFlags.None);

But still nothing.

PARTNERS