Shaders....

Started by
1 comment, last by Jorj 18 years ago
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
Advertisement
BasicHLSL sample:
Quote: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]

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

thanks, must of missed that - i feel silly now

- Jorj

This topic is closed to new replies.

Advertisement