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

help with materials and lights sample

Last post 9/13/2008 1:44 AM by nca2003. 4 replies.
  • 9/7/2008 8:59 PM

    help with materials and lights sample

    The Materials and Lights sample does not work properly for me.  I get an exception immediately saying:

    "Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before any draw operations may be performed."

    This problem is only with the materialshader30.fx file.  If I force the initial support check to use materialshader20.fx then the sample works fine.  Then, if I change the materialshader20.fx file to compile with shader version 3.0 it also works fine.  Is there a bug in the materialshader30.fx file?

  • 9/8/2008 5:03 PM In reply to

    Re: help with materials and lights sample

    What graphics card are you using?
    XNA Framework Developer - blog - homepage
  • 9/9/2008 4:14 AM In reply to

    Re: help with materials and lights sample

    radeon x1800 series, 256mb (pro or xt, I forget)

    (EDIT: installing the latest drivers didn't fix the problem)

    Also on a possibly related problem, the multipass lighting sample doesn't work for PS 3.0 either, the problem here being that it draws the light meshes, but no illumination.  (no exception thrown on this sample)  But again if I force shader 2.0 in this sample, the illumination works and the sample has no problems.

  • 9/10/2008 8:07 PM In reply to

    Re: help with materials and lights sample

    I seem to be having a problem with the HLSL for loop.  I wrote my own shader in FX Composer using a for loop for point lights.  It worked fine in the FX Compser render window, but then when testing it in XNA it throws the "Invalid Vertex/Pixel Shader that I got above in the sample.  If I hard code the loop to use <= 6 point lights, it will work in XNA.  More than 6 hard-coded or using a shader parameter for the loop's test and it fails.  My shader is compiled with vertex and pixel shader 3.0.  Any ideas what the problem is?
  • 9/13/2008 1:44 AM In reply to

    Re: help with materials and lights sample

    I'm still hoping to get this worked out.  Are there any known issue with my graphics card?  Does anyone else have problems with for loops in HLSL that test against a shader parameter and not a constant?
Page 1 of 1 (5 items) Previous Next