Vio Lence

Member
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Vio Lence

  • Rank
    Newbie
  1. [quote name='programci_84' timestamp='1327407457' post='4905762'] Can we see your loading/rendering and effect file code? [/quote] Yes,I have actualy also written it here,the code is posted here [url="http://stackoverflow.com/questions/8980641/fx-files-mostly-dont-load-and-those-that-do-dont-work-properly"]http://stackoverflow...t-work-properly[/url] and I have a link to 2 fx files I tried in the comment,but it seems that nowhere anyone can help me with thos problem.I mean yeah,some of them were ps_1_x but I fixed them and still they render not how the're supposed to or the entire geometry just dissapears and the frame rate drops 5-fold... Also,to someone inexperienced like me,do you think it's even a good idea to use an Effect class used by Model classes anyway?Or is it better to make an effect class use model classes,since Begin() and End() are probably heavy,so it would probably be better to just call it once for all models instead of once in each?
  2. [img]http://store.picbg.net/pubpic/B6/EE/f1f130e19681b6ee.png[/img] this is what happens when I apply any FX file on my planet model(it usually has a red texture),I tried all sorts of effect files,some cause grey waves on the edges,some cut the sphere in half,but none work properly,why would that be?I'm using the standart procedure - load,set a handle to next technique,set parameters,do the loop with passes..
  3. For some reason I keep getting an error when I try to load an fx file in my Effect class,here is the loader function [CODE] HRESULT CFXFileEntity::Load(std::string path) { HRESULT hr; if (FAILED(hr=D3DXCreateEffectFromFile(m_d3dDevice,path.c_str(),NULL,NULL,0,NULL,&anEffect,NULL))) return hr; if (FAILED(hr=anEffect->FindNextValidTechnique(NULL,&hTech))) return hr; }[/CODE] it doesn't return any hr value(???) and it crashes at this line: [CODE]if (FAILED(hr=D3DXCreateEffectFromFile(m_d3dDevice,path.c_str(),NULL,NULL,0,NULL,&anEffect,NULL)))[/CODE] I've tried different simple fx files,both from RenderMonkey and from FX Composer and it always crashes,debug says the error code is [quote] Unhandled exception at 0x546d1ea8 in GAME.exe: 0xC0000005: Access violation reading location 0xcccccccc.[/quote] what could be causing this?
  4. What must I include to use these structs?I can use D3DXMESHCONTAINER with the basic d3d files- <d3d9.h>,<d3dx9.h> but what about the extended struct?
  5. Huge .fx confusion? ;(

    [quote name='MJP' timestamp='1326658540' post='4903027'] You're not checking the return code of D3DXCreateEffectFromFile. It's probably failing, which means the effect pointer will be NULL and your program will crash when you try to access it. You should check the error code, and if it fails check the ppCompilationErrors pointer for a buffer containing compilation errors. You can also turn on the debug runtimes to get additional information on why a function call failed. [/quote][quote name='MJP' timestamp='1326658540' post='4903027'] You're not checking the return code of D3DXCreateEffectFromFile. It's probably failing, which means the effect pointer will be NULL and your program will crash when you try to access it. You should check the error code, and if it fails check the ppCompilationErrors pointer for a buffer containing compilation errors. You can also turn on the debug runtimes to get additional information on why a function call failed. [/quote] do you think it's a good idea to make of it some sort of Effect class and simplify it into Load/Unload/Render methods? Q_Q or do different effects require too much specific operations?
  6. So I basically started writing an engine for a 3d game,I was new to DirectX,but I'm a quick learner,so far I've got down the camera system,a model class,a sprite class(for corsairs moving on screen and stuff) and some input/output functions to read .x files.The real surprise was when I tried to load .fx files.I mean I'm not sure I'm getting this...the other stuff works flawlessly,but when I load a fx file with the code from any tutoria,it crashes.The debugger says the problem is here: [CODE] iPass = 0; cPasses = passes; D3DXCreateEffectFromFile(m_d3dDevice,path,NULL,NULL,0, NULL,&anEffect,NULL); [color=#ff0000]this->anEffect->FindNextValidTechnique(NULL,&hTech);[/color] [/CODE] they are a part of the model class and without the fx code,it all works properly,this is the tutorial that i read about fx files from: [url="http://www.toymaker.info/Games/html/effects_files.html"]http://www.toymaker.info/Games/html/effects_files.html[/url] also when I open an example solution from the SDK and i replace the example .fx in it with another .fx(i've tried replacing it with ones I downloaded as well as ones I made with FX Composer) and it too crashes.Is there some other source where I can learn about using .fx files?I never imagined that would be the hardest part of the 3d engine. [img]http://public.gamedev.net//public/style_emoticons/default/mellow.png[/img]