XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

Normal Mapping rendering issue in ShipGame

Last post 11/15/2009 3:57 PM by Fuzzy Bug. 1 replies.
  • 11/14/2009 9:14 PM

    Normal Mapping rendering issue in ShipGame

    Hello

    I'm trying to lift the rendering from the ship game and stick it into my own framework.  Everything works but the model renders with the wrong texture - the one I'm seeing is ship1_i.tga so the model comes out black with the odd blue bit.  When I build the ShipGame it's fine but I can't see what I've missed.  I'm using the same normalmapping content processor and the same normal mapping fx.  The binary files match up size wise between both versions.  Makes no difference what model I'm using from the shipgame either (I'm yet to try exporting my own out).

    When it does render the black areas look see through, the glowy blue bits come out ok and where light catches the spaceship I can see the normal mapping in action.  I've tried switching it to using the PlainRendering option but that just switches the lighting off and still renders with the wrong map.

    I realise it's a tricky one but I don't suppose anyone has any ideas on what would cause it?

    --edit--

    Changing the normalmapping.fx so rather than color.w = glow_intensity; it's color.w = 0.5 lets me see the texture but it's quite bright and glowy. 

    It's definitely the glow_intensity, all the maps looks fine but as soon as I set the color.w = glow_intensity it goes wrong.  I don't see what bit of the sample I'm missing that would affect that though.

    --more edit--

    Right.  Well it seems that my render output looks like the glow texture and the results of the specular lighting. Where there's no glow or specular lighting hit there's nothing drawn (except the clear colour).  I've no idea why now.  I've scaled back the shipgame demo so it's not doing much else other than clearing the screen and drawing a ship and what I have seems to match code wise. 

  • 11/15/2009 3:57 PM In reply to

    Re: Normal Mapping rendering issue in ShipGame

    Finally.  It appears I was missing a renderstate...

    graphics.GraphicsDevice.RenderState.DepthBufferEnable = true;
    graphics.GraphicsDevice.RenderState.AlphaBlendEnable = false;
    graphics.GraphicsDevice.RenderState.AlphaTestEnable = false;

    One (or all) of those fixed it.

Page 1 of 1 (2 items) Previous Next