Jump to content
  • Advertisement
Sign in to follow this  
dudz

HLSL Help!

This topic is 3626 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

*Sigh* Im really struggling to get to grips with it, i've been over countless tutorials and i understand the concept and the theory behind using effect files and shaders etc but i cant get mine to work!! So frustrated! If someone could have a look over my code for me i'll be extremely grateful, lol. I keep getting the famous "Object Reference not set to an Instance of the Object" error, when i reference my effect file in the XNA code. Heres the project: http://www.zshare.net/download/537748687fb58dc0/ Someone help me before i destroy my computer, haha.

Share this post


Link to post
Share on other sites
Advertisement
I would look at your code but im on a work computer so I better not but.

What is the problem? is it not rendering? is it crashing? are you checking the results of your API calls?

The first thing would be to figure out where its breaking.. either the game code or the fx file itself

Share this post


Link to post
Share on other sites
Hi, im getting the error in my Game code, more specifically, the Draw method of my Model class. The error is probably caused by me referencing the effect file since im completely new to using XNA im sure i've screwed something up haha. The error is caused when im setting the parameters of the effect (W.V.P and lighting etc....)

Thanks

Share this post


Link to post
Share on other sites
is it the first time you referenced the effect object? did you check to make sure it was created from the file correctly?

I just realized you are using XNA >.>; I am not familear with that either but im ok with the effect system in d3d9 at least.

Share this post


Link to post
Share on other sites
Quote:
Original post by agaudreau
is it the first time you referenced the effect object? did you check to make sure it was created from the file correctly?

I just realized you are using XNA >.>; I am not familear with that either but im ok with the effect system in d3d9 at least.


I referenced the Effect file in the Game1.class as:

Effect myHLSLEffect;

Then loaded it in that same class.

I then have the effect in my Model class which is used in my draw method for setting the effects parameters.

[Edited by - dudz on January 7, 2009 1:23:19 AM]

Share this post


Link to post
Share on other sites
well it sounds to me that because it crashes when you try to use the effect object that it is not created correctly. Sorry I cant be more help though, ive been trying to stay away from XNA as much as possible.

here is a tutorial site for xna hlsl that might help to compare code line for line to see if anything pops out at you.

http://www.ziggyware.com/weblinks.php?cat_id=9

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!