March 12, 2015 at 3:11 pm #346
Cheers Paul =). Btw if I am getting just a blue window (so in Triangle demo no triangle or frame rate sprite) what is the likely cause? When I try to run my application outside of VS it says that d3dcompiler_47.dll is missing? Is this a huge issue. It seems to load the blue screen only through VS.
MitchMarch 12, 2015 at 4:50 pm #347
I actually looked at another similar post about a guy who only got a black screen. Just to clarify a few points.1) I ran through all the shader chapters and they worked fine in FX Composer. 2) I appear to have DirectX 11 also. 3) I only get a blue screen with no text or triangle. 4) Other errors I get are:
First chance exception in game.exe: _com_error. Also a load of cannot find or open PDB file errors when looking for .dll files.
5) I have tried changing the shader model also
Hope this helps =)March 12, 2015 at 6:13 pm #348
It’s possible that you’re having a shader compilation error. For Chapter 14, the shader that’s used (BasicEffect.fx) is being compiled at run-time. You mentioned a missing d3dcompiler_47.dll file — which is the library that’s compiling that shader. I would expect the same behavior both within Visual Studio’s debugger and outside, but this is one place to look.
Specifically, I recommend that you put a breakpoint on line 45 of TriangleDemo.cpp. That’s the call to D3DCompileFromFile. Step through the code from line 45 to the end of the TriangleDemo::Initialize method and see if you get any errors.
That you have this shader working in FX Composer is great. But I wouldn’t discount a shader model 5 issue just yet — even though you tried changing it to shader model 4. Here’s why: whenever you modify the .fx files within the project itself (e.g. the source\Library\Content\Effects\BasicEffect.fx file) that is not the file that’s being loaded by the Game.exe. As you discovered through our earlier discussion, those content files have to be copied to the location of Game.exe (e.g. build\Debug\Content\Effects\BasicEffect.fx).
That copy only happens when a build is initiated, and only when the build actually runs. Those .fx files (when compiled at run-time and not at build-time, as they are in Chapter 14) will not trigger a build when they are changed. You’ll need to either modify a C++ file or perform a “Build | Rebuild” in order to trigger a build so that the pre/post-build events fire and copy the .fx files to the .exe location.
It’s easy to see if your modified .fx file has been copied to the .exe location, just open it up (e.g. from build\Debug\Content\Effects\BasicEffect.fx) and see if it has your changes in it. You could also edit the file directly at this location. However, it’ll be overwritten the next time you perform a build/rebuild.
PaulMarch 13, 2015 at 9:10 am #349
Hey Paul, ok cheers I’ll do this when I get back home. I did make sure I rebuilt the solution after updating my .fx file but it still didn’t work unfortunately. Just another note that I picked up from Internet reading: I have windows 7, does that make a difference? Also it says in a lot of places that I need to explicitly include the path to d3d_compiler_47.dll. Is this true? The fact that the ,dll is missing would explain why my triangle or sprite aren’t being rendered. I will try break points when I’m back though. Cheers
MitchMarch 13, 2015 at 9:58 am #350
Yes, from the perspective of what DirectX libraries are installed with the operating system, Windows 7 does make a difference. Windows 8.1 installs d3dcompiler_47.dll, but Windows 7 does not. Just make sure that you’ve installed the Windows 8.1 SDK. Note: the Windows 8.1 SDK runs just fine on Windows 7.
As to specifying the path to that .dll, no you don’t need to do this. An .exe will look in C:\Windows\System32 (assuming that’s where you’ve installed Windows) and the directory of the .exe file to file dependent .dll files. However, if you haven’t installed the Windows 8.1 SDK, that’s likely your problem.
PaulMarch 13, 2015 at 12:48 pm #351
You were completely right! I checked my .fx file and indeed it hadn’t updated to the OutDir (I checked the wrong directory last night by mistake) Obviously my poor laptop cannot support shader model 5. So now I get a spinning cube but still no Frame text (unless that was supposed to go). I did have SDK 8.1 and the d3dcompiler_47.dll is found under Program Files(x84)/Windows Kits/8.1/bin although oddly it is still saying that it’s missing?
Although only a triangle is rendered it is nonetheless pretty exciting and I am very pleased =)
MitchMarch 15, 2015 at 11:34 am #355
Hey Paul just to update and say that everything is working sweetly now =). I disabled the FpsComp in the triangledemo which is why it wasn’t working.
Just again a quick (final) question about Graphics Programming in the game industry (as I saw you worked with the likes of EA etc). What would be your typical day in the office? As a Graphics programmer would it be your job to say program how water is rendered or how the sky looks when looking at it etc? How much is the graphics programmer involved with the actual special effects? ( I know I asked a similar question earlier but now I am putting it in the context of a Games industry developer ).
The visual side of the game is always one that appeals the most to me, so it would be good to be able to work on that stuff whilst still coding (as I love that too).
Thanks man, that’s the last question I promise =)
All the best,
MitchMarch 16, 2015 at 9:04 am #359
A typical day for a graphics programmer is to work on engine and shader code, attend meetings, profile and debug code, and research techniques that are required by (or could be useful to) your game. A graphics programmer would definitely be involved in rendering water and sky — but they won’t do this alone. Artists are supplying assets that you’d render, and how much/what type of any of this work varies from company to company.
When you ask about special effects, I assume you are referring to particle effects (e.g. explosions, smoke, dust, etc.). Yes, you’d be involved in this as well but it’s less about authoring specific effects and more about creating a platform for such effects to reside within.
PaulMarch 16, 2015 at 9:24 am #360
Ahh ok I see, so it will be more an artist say “hey I have this object, I want it to look like this and have these shadows etc” and you going off and writing hlsl for this to occur and writing c++ to implement this?
I understand about the sfx too. Are authoring those more an artists job?
Cheers for answering all these questions, I bought dying light last night and the visuals in it are amazing (especially water (rain in particular) and the sky). I was just really interested to know how much I would have an impact on those visuals as that’s the thing I am really the most fascinated by.
Thanks so much, I’m still loving your book and I’m finding it such a useful learning guide 🙂
MitchMarch 18, 2015 at 3:42 pm #361
Yes, that’s something like what happens. And yes, authoring visual effects typically falls to an artist.
Glad you are enjoying the book and are inspired by amazing games!
You must be logged in to reply to this topic.