Jump to content


Member Since 10 Apr 2013
Offline Last Active Jun 04 2015 06:32 PM

Topics I've Started

Lots of warnings.

26 February 2015 - 11:24 PM

I've recently got back in to programming after a long hiatus. I'm starting with a blank screen. The code builds and I get a nice blank screen. But the output is a load of warnings.


I pasted them here: http://pastebin.com/gWbGsm6z


Why is that happening?


It doesn't seem to be related to any of my code. But rather the headers. It's something I'd rather not ignore but I have no idea what's causing it.


Win7/VS2013 if that's relevant. I seem to remember something about Win8/SDK and warnings but I've forgotten.



Pixel Perfect

23 October 2013 - 11:39 AM



Not sure if this counts as a beginner question or not. I apologise if it's in the wrong section.


I'm currently playing around with some deferred rendering. It seems to be working ok. I have directional and point lighting. I'm rendering the lights in to a render target and then using that to calculate the final stuff. But I think my projective co-ords are slightly off. If you look at the image below you'll see that at the geometry edge there's a white line. As though the lighting texture doesn't quite match up.




The code I am using to build the projective co-ordinates is as follows:

//suv are the co-ords for tex2Dproj()
//invWidth is (0.5f / screen_width)
//invHeight is (0.5f / screen_height)

v2fout.p       = mul(a2vin.p, wvp);
v2fout.uv      = a2vin.uv;	
v2fout.suv     = v2fout.p;
v2fout.suv.xy  = float2(v2fout.suv.x * 0.5, -v2fout.suv.y * 0.5);
v2fout.suv.xy += (0.5 * v2fout.suv.w);
v2fout.suv.x  += 0.5f * invWidth * v2fout.suv.w;
v2fout.suv.y  += 0.5f * invHeight * v2fout.suv.w;

Thanks for any help/advice.

Adding Elements ?

11 April 2013 - 07:26 PM



I've spent the day getting a triangle to render in SlimDX and reading up on things. It was all going well until I tried to make the shader a little more complex. I just want to add a per-vertex colour. But when I did my vertex layout broke and I'm not sure why. The exception being thrown is the following:



An unhandled exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll
Additional information: E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809)


I managed to find a thread that seems related: http://www.gamedev.net/topic/607455-slimdx-directx11-inputlayout-failure/


I'm not sure if that really helps or not as I don't fully understand it. He seems to be passing his DataStream as the signature which I'm not doing( Or if I am it's in such a way that I don't realise I am. ). I'm using the ShaderByteCode from the vertex program. This all worked for a triangle with only positional data being sent. It breaks on the Layout creation line.



            var elements = new[] { new DX.InputElement("POSITION", 0, GI.Format.R32G32B32_Float, 0),
                                   new DX.InputElement("COLOR", 0, GI.Format.R32G32B32A32_Float, DX.InputElement.AppendAligned)
//Breaks on this line.
            VertexLayout = new DX.InputLayout(CoreComponents.mVideo.mDevice, HLSL.ShaderSignature.GetInputSignature(VPByte), elements);


The shader looks like this:



struct a2v {
float3 p : POSITION;
float4 c : COLOR0;
struct v2f {
float4 p : SV_POSITION;
float4 c : TEXCOORD0;
v2f vp(a2v a2vin) {
v2f v2fout;
v2fout.p  = float4(a2vin.p, 1);
v2fout.c  = a2vin.c;
return v2fout;
float4 fp(v2f v2fin): SV_TARGET {
return v2fin.c;


Any help or advice would be appreciated. Thank you.