Sign in to follow this  


Recommended Posts

Ok, after working out how to load models and do shadows my next task is to improve the look of my program with shaders...this all seems good, and ive been playing around with RenderMonkey for a while now - but theres one problem: once i have a *.fx file how do i apply it to a mesh? there is an effect instances variable on the D3DXLoadMeshFromX function - is this where i need to look? I dont think it is because i have the shaders in a different file. I tried googling but all the tutorials seem to teach you to make shaders - not apply them, and the directx SDK doesn't seem to have a good demo of loading a *.fx file, i expect its just because the answer is so obvious that it seems silly to show you how....but i still don't get it... thanks for your help - Jorj

Share this post

Link to post
Share on other sites
BasicHLSL sample:
How the Sample Works

First the sample loads the geometry with D3DXLoadMeshFromX and calls D3DXComputeNormals to create mesh normals if there aren't any. It then calls OptimizeInplace() to optimize the mesh for the vertex cache, then loads the textures using D3DXCreateTextureFromFile. Next, the sample calls D3DXCreateEffectFromFile to compile the effect text file to a ID3DXEffect* interface called m_pEffect.

Sounds like it should cover what you're after... Struck me as a fairly straightforward no-nonsense sample when I looked at it [smile]


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this