Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Apr 2011
Offline Last Active May 23 2014 10:00 PM

#5138113 Are some people not cut out for programming?

Posted by axefrog on 11 March 2014 - 08:44 AM

So I decided to write a c++ parser, lots of string manipulation, plenty of substr's and find_first_of \n \t \f et al.

How long have you been coding for? I've been at it for over 15 years and I am still improving to this day. Generally speaking, and based only on my limited observations, it takes 5 years to become reasonably competent and 10 years to get past your desire (and failed attempts) to overarchitect things and reinvent wheels, and start to feel really competent. And even at 15 years you'll feel a lot more competent than you did at ten years of experience. Best advice is to not lose heart, keep coding, do the best you can and accept that you'll have to go through all of the failures, mistakes, different types of development processes, and so forth, in order to truly understand what you're doing and what the implications of any of your decisions will truly mean. Learn by doing and improve with each attempt.

#5137752 Cull mode inverted for some reason?

Posted by axefrog on 10 March 2014 - 03:33 AM

It’s not. First you define which direction defines a front face (clockwise or counter clockwise) and then you decide whether you want to cull front faces or back faces. I personally use clockwise, but whether one is used more than the other or by whom one is used is rather arbitrary—there is no reason to pick one over the other except that that is how your toolchain works.

L. Spiro

Ah, thanks, that's helpful. I wonder if it's a bug in SharpDX for configuring the Rasterizer.Default() method to have the winding order mismatched with the cull mode.

#5136708 Visual Studio 2013 wariness.

Posted by axefrog on 05 March 2014 - 11:54 PM

I'm using VS2013 Professional and have experienced none of the negatives you listed. It's super stable and everything works fine. It didn't require me to use Internet Explorer in any capacity. Sometimes issues in an application can come down to a very unique set of circumstances on your own machine. I am on Windows 8.1 if that makes any difference.

#5133517 SharpDX - SwapChain1 - where are the constructors?

Posted by axefrog on 22 February 2014 - 06:53 AM

I'm currently going through Direct3D Rendering Cookbook, 2nd Edition and in the first chapter it's constructing an instance of SharpDX.DXGI.SwapChain1 and providing a number of parameters, as per the SharpDX source code here. Now, I've installed the latest from the SharpDX website, and am referencing the assemblies in the DirectX11_1-net40 folder, and I'm also running on Windows 8.1 with DirectX 11.2 (which my video card supports), and yet in my code, the only exposed constructor I have access to is SwapChain1(IntPtr nativePtr). There is absolutely no sign of the constructors I linked above in the SharpDX source on Github.


Any idea what I might be doing wrong?


Screenshot of the code from my Kindle Reader:



Screenshot of me not being able to write the above code on my machine:



#5133213 [SharpDX] After changing my noob code to use a technique instead of shaders d...

Posted by axefrog on 21 February 2014 - 04:21 AM

I solved the problem. I wasn't setting the constant buffer properly.


#5133184 [SharpDX] After changing my noob code to use a technique instead of shaders d...

Posted by axefrog on 21 February 2014 - 01:35 AM

I normally wouldn't ask anything like this, I hate it when people dump code on forums and expect you to debug it for them. I am however completely stumped and have nowhere to turn, so I figure if I can keep things succinct, maybe one of you fine folks might be able to spot where I am going wrong.


Also, I'm a big fan of the concept "give a man a fish and you'll feed him for a day, teach a man to fish and you'll feed him for a lifetime", so I'll be describing the problem below, but I'd really appreciate if you could help me understand how I could have debugged the problem myself. Normally when developing software I am able to debug almost anything via a process of elimination, narrowing the problem range, observation of values while in debug mode, following stack traces and so forth, but in this case it's completely unclear what I need to look for mainly due to my inexperience working with the Direct3D APIs.


Note: any linked words below go directly to source code on Github for your reference.


Ok, so I've been learning basic 3D programming with Direct3D 11 using SharpDX. I had a nice test project (source here) working that would display some animated rainbow-coloured cubes and was shading them using individually-compiled vertex and pixel shaders. The vertex shader was just for the basic transforms and the pixel shader just picked an interpolated colour. This all worked fine, as you'll see if you feel like compiling the source code.


The next chapter in my book has been talking about using effects files and so I copied my source to a new project (source here), and took my vertex and pixel shader code, put them both in the same .fx file and added code into that file to describe the technique that should encapsulate both shaders, with the intention to apply the technique in my code rather than hooking up the shaders directly.


My new class for making use of the technique replaced my shader classes I had in the old version of my project and I started using "pass.Apply" to render, rather than setting the vertex and pixel shaders manually before calling my Draw() methods. So my renderer now calls directly into my effect class to do the drawing. Note also that my initialization of the input layout now takes the input layout from the signature of the first pass in the technique, rather than directly from the vertex shader which it did in the old version.


Even though my code seems to be straightforward and I've attempted to follow examples and understand what I'm doing, no cubes are rendering anymore. All I get is a blank background.


Any help would be much appreciated, and in particular any suggestions on how I could have figured out the problem myself, for future reference.

#5106423 SharpDX - How to set my vertex shader to take an instance's world matrix...

Posted by axefrog on 02 November 2013 - 07:10 AM

Just wanted to say thanks to those who helped me sort this problem out. The results are below. I will of course keep building on this knowledge until I attain mastery smile.png




p.s. I blogged about it, for anyone who cares: http://nathanridley.com/2013/11/01/6-houston-we-have-instancing-and-animation/

#5105657 Abstracting away DirectX, OpenGL, etc.

Posted by axefrog on 30 October 2013 - 07:53 AM

As the others have mentioned several times, I would also suggest tackling one of the APIs at a time.  If you can write a renderer in one API, then another renderer using the other API, then you will be moderately equipped to design a system for putting the two together.  Also, keep in mind that your designs will surely evolve as you tackle different challenges, so don't be afraid to experiment and shake things up.  Especially if this is a hobby project - don't limit yourself right out of the gate, but rather challenge yourself to make some big steps in the design!


Agreed, and I have sort of come to this conclusion as well. I wouldn't explicitly call what I'm doing a hobby project, as I'd like to do it commrcially, full time in the future, but I have a lot of learning to do first.


I was very similar to you. When I first started using Direct X 7, I wanted to create an abstraction layer so I'd later be able to support other things, maybe even other OS. Well I still think this is a good idea, at the time I was new to graphics programing and just learning DX 7 was a huge task for me. I never ended up supporting any other API, and when I moved to DX8, I scrapped most of the code anyway. (FYI, first attempts usually suck.)

Now that I've written like 5 or 6 different 3D engines, I've finally think I have enough knowledge to do a multiplatform framework. It's working well, but after I finish this game, I'll probably redesign it yet again.


They say, figuratively, that you do everything at least three times; once to learn how to do it, once to do it, and once to do it properly. The third stage is probably more of an endless series of improvements and rewrites, but such as life in the world of development. I've been through this process repeatedly in web and application development, but 3D graphics programming is a whole new ball game, so it's back to the drawing board, to a large degree.

#5102358 Where to start?

Posted by axefrog on 18 October 2013 - 05:01 AM

Hello, I began to learn and want to learn pseudo C + + to make a game like stronghold. Where to start, what I need to do this. You can give me some tutorials or some resources?


This is like saying "Hello I've just been born and want to get a job as a supreme court judge". Start simple- work on small, simple projects each of which let you learn a bit more than you knew before, so that you can build up to the level you need in order to work on the game you really want to make. If you try to bite off more than you can chew, you'll probably end up overwhelming yourself and losing motivation.

#5102357 How do you 'learn' a programming language?

Posted by axefrog on 18 October 2013 - 04:56 AM

The problem when you start out programming is that your brain is not really trained to think at the sort of logical level required to effectively deconstruct problems and create logical solutions. The only real way to train yourself to think this way is to force yourself into situations where you must think this way to solve the problem. In other words, however little you know, use it to write something.


First, why not try to write a simple guess-the-number game? Look back over your code and try to work out what you could have done better. Post your code in a Gist (over at Github) and ask people here to help code review it for you, but be sure to explain what you're happy with and what you think could be improved (i.e. what effort you've put in so far to that end). Code review with peers is very important to your growth as a developer, so don't try to do this in complete isolation or you'll slow your growth down severely. Last but not least, be extremely self-critical and always seek to do a better job with your coding than you have previously. After 15 years of coding myself, I still find things I can do better and I always assume that there are plenty of others out there who are much better than me, that I can learn from. With that attitude, you'll pay attention to programming articles, you'll investigate how others have solved problems similar to what you're working on and you'll stay on top of the curve in general, just because you're genuinely interested in being the best that you can be.


Finally, expect road blocks and frustrations every step of the way, but don't let them stop you. Be relentless in trying to understand the individual aspects of what you're doing and in figuring out the issues you're trying to solve. StackOverflow is an invaluable resource, use it! Khan Academy is fantastic for fundamentals such as math and physics, when you need them, and there are plenty of other online learning resources that cost you nothing as well. Remember, when your head feels like sand after feeling like you've been beating it against a problem for hours, know that your knowledge and skill is growing. When you relax and especially when you sleep, your brain is reprocessing what you've experienced during your coding and is optimizing its neural connections little by little so that, with persistence, you'll become more and more proficient in every aspect of what you're doing.


It will take time, but persist and you'll win!

#5100227 Logging my journey to learn game development

Posted by axefrog on 10 October 2013 - 11:11 AM

Hello, I guess this is also my first forum post! I want to maintain a thread as a companion to the blog I've started, for two reasons (a) nobody knows my blog exists, and (b) sometimes I want to post and a whole blog post seems overkill when I only want to say something minor.


So.. yeah basically I've been a developer for around 15 years (mostly full-stack web development, with a focus on .Net), and although I've always wanted to develop games, my time has always been taken up by web development projects, which has also been my career. But though the whole reason I learned programming so long ago was because I wanted to make games, it just seems life got in the way! I know how to code, I've been doing it for a long time, I'm just very lacking in game-specific knowledge (3D programming, advanced maths, relevant algorithms, etc.). When I sat down with the intent to plot some raw pixels using DirectX, it was clear I had no idea what to do. I have some pretty big ideas, but it's going to take me some time to actually gain enough knowledge and experience to implement those ideas, so I've got a lot to learn first.


Anyway, I want to start this thread to track my progress from day #1. I'm going old school to begin with. I want to learn 3D graphics fundamentals so that I have a better understanding of what I'm doing; a firmer foundation on which to build the rest of my skills. With that in mind, I'm starting by attacking the ancient "Tricks of the 3D Game Programming Gurus", which was written in 2003 and covers the basics pretty well (and I actually have a copy, so I don't have to go out and buy anything). I am convinced that being able to write a pure software-based 3D engine from scratch is going to be full of very valuable lessons and insight which will help me as I move onto more advanced things. I've also got a list of other books I've carefully selected, that I think will help me once I'm done with this book, but first things first.


In the last 24 hours, I've had two attempts at "Hello World", one using MonoGame, and one using SharpDX. I'm going with SharpDX because I don't need cross-platform, and I don't want the extra "help" provided by MonoGame when I'm trying to learn the basics. You can read about the specifics here: http://axefrog.wordpress.com/2013/10/09/1-hello-world/ and here: http://axefrog.wordpress.com/2013/10/10/2-hello-again-world/


They're probably not very interesting to a lot of you, but I'm going to do my best to stay consistent here. I'll post screenshots of what I've done and if you're interested, you can follow along. At the very least, it's an exercise to keep me from lapsing on this journey for too long. I do still have my primary work so I can eat and so forth, but I will do my best to make sure I post every few days at least. Also, my blog posts will try to expand a lot on what I post here, and I'll post code snippets and specifics of what I've learned.


My first success: