Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jul 2009
Offline Last Active Nov 09 2012 04:47 PM

#4890155 Writing a game engine

Posted by on 03 December 2011 - 09:57 AM

Out of curiosity, why don't you like the engine you got from school?

Also, I agree with the comments. Writing an engine is not an easy task. I suggest you focus on the game and use what has been given to you. You say you can write an engine in one month and finish the game in the remaining months... let's assume for a moment that it's an accurate time estimate. That's one extra month you can use for making the game shine. IMO having a polished game will cause a bigger wow factor than having your own engine.

It's also good practice for you if you break in to the industry. Unless you become an engine programmer, you will be using an engine written by another team (or company altogether). Even if you are an engine programmer, you probably won't be writing all the code yourself and will have to deal with code from other developers.

So again, what is wrong with the engine you got from school?

#4890149 improve my code. Only if you have 10 min of your time

Posted by on 03 December 2011 - 09:23 AM

I did not spend a lot of time looking at the code, but I would say you're off to a good start :)

Things to be careful with IMO:

1. I suggest establishing a coding convention, even if this is a hobby project. You have some variable names that start with upper case and others that start with lower case. And I see the same for functions. It looks messy.

2. You're not using indentation on your "if" statements. It's easier to read code if it follows appropriate indentation.

3. You may want to start looking into vertex arrays and VBOs. Immediate mode (glBegin()/glEnd()) is slower, and if you wanted to use DirectX, you won't find immediate mode in it.

4. I'm being too nitpicky with this one, but "Feet" is already plural. The word "Feets" doesn't exist. The singular version of "Feet" is "Foot". If someone else looks at your code, it's important for it to be correct / look good in all aspects.

5. By "Stomek", I think you meant "Stomach". Again, I'm being too picky, but it's important.

Please take this as constructive criticism... I hope it helps :)

#4847817 Ambient occlusion simulation for AAA projects

Posted by on 11 August 2011 - 12:33 PM

Guys, i'm bored. When i came here to ask, expected something like this, but not such negative to me without any trust. How dare are you to tell me that i'm lier, bad and rude if you guys just trolling me? What actually do you want from me by saying all of that? I'm not the competitor, i'm not advertising, i wasn't angry. If someone making things better than others, is that bad? You are redicilous if it's like that. Proove me then that you can do better, otherwise shut up or just help me.

Judging by your attitude, you're looking like the troll to everyone else. I wish I could help you, but I don't have money to give you. Even if I had the money, I have a choice of many algorithms to choose from. Many of them are freely available, so why would I pick yours? If you say it's because of quality, then I'd say this... if I was making a simulation where I absolutely needed your AO, then I'd talk to you (but how can I tell if I need your AO if I don't know your history and I've only seen a few images?). But if I'm making a game where graphics is just one part of a much larger equation, then I would think twice before asking for your top secret algorithm.

#4845071 [DX9] frames per second

Posted by on 05 August 2011 - 10:10 AM

You'll have to turn off V-Sync.

EDIT: here's how...


#4841282 Hi, I would like some advice on HLSL and textures

Posted by on 27 July 2011 - 02:23 PM

I also like the effects framework. Makes it easy to organize shader code :)

In that case then, you'll be calling SetTexture on an effect instance similar to this:

pD3DXEffect->SetTexture(0, pTexture)

instead of on the device:

pD3DDevice->SetTexture(0, pTexture)

#4841274 Hi, I would like some advice on HLSL and textures

Posted by on 27 July 2011 - 02:09 PM

AFAIK, the SetTextureStageState functions are meant for the fixed-function pipeline. You can set up multitexturing with them, to do lightmapping for example. If you use the SetTexture() function and set multiple textures 0, 1, 2, etc... then you can use them in the shader according to the texture register number. Will you use the DirectX effects framework, or setup vertex and pixel shaders separately?

Which engine are you using?

#4840251 custom build tool confusion

Posted by on 25 July 2011 - 05:17 PM

Looks like you're trying to compile a pixel shader... what is the content of color.ps?

Does it have a function called "main" ? The compiler is telling you that an entry point called "main" is missing. That's probably the default entry point. But I'm sure there's a way to provide an alternate entry point.

EDIT: looks like the way to provide an alternate entry point is:

/E <entry_point_name>

reference: http://msdn.microsoft.com/en-us/library/bb509709(v=vs.85).aspx

#4835527 [XNA] [HLSL] Tangents and Binormals

Posted by on 14 July 2011 - 07:46 PM

This link has a good explanation of how to compute the TBN matrix. It has C++ code, but it can easily be converted to C#.


#4834871 CUDA hello world MSVC

Posted by on 13 July 2011 - 09:49 AM

Check this out, there's a comment by "Mike" that might help you (last comment atm):


It explains one solution to the "nvcc fatal: Visual Studio configuration file (null)" error. It has something to do with needing to make a 32-bit build on a 64-bit machine.

These might help too:



#4834870 CUDA hello world MSVC

Posted by on 13 July 2011 - 09:43 AM

Are you sure you're setting up the project correctly? AFAIK, you need to compile CUDA code with the CUDA compiler, "nvcc".

Also, I wouldn't say you've wasted your money... unless you're quitting after one simple error...

EDIT: sorry I didn't read the part about you compiling with nvcc... never mind. Will keep looking for solutions.

#4834000 Is depth buffer not working ?

Posted by on 11 July 2011 - 03:45 PM

how do I enable depth writing ?

See http://www.khronos.org/opengles/sdk/1.1/docs/man/glDepthMask.xml

#4833876 Tracking Time

Posted by on 11 July 2011 - 12:05 PM

If you get an endFrameTime that is less than a startFrameTime, I think you could calculate the timeDiff by:

[max LARGE_INTEGER value] - startFrameTime + endFrameTime

#4833831 Updating Texture Regularly

Posted by on 11 July 2011 - 11:11 AM

That sounds about right...

Just to confirm... you create the texture once, then every frame:

1. Lock it
2. Update it
3. Unlock it
4. Bind it to render with it

just out of curiosity, what kind of updates are you doing to your texture?

#4832801 Help (understand) convert small vector code to C#

Posted by on 08 July 2011 - 09:02 AM

fract is a GLSL built-in function. This reference doc should help in implementing it yourself:


syntax like comp.xxyz is special shader syntax that allows repeating vector components and allows swizzling components. In this particular case, comp.xxyz means that you have:

vec4(comp.x, comp.x, comp.y, comp.z)

#4832496 Animation

Posted by on 07 July 2011 - 02:53 PM

One way to do it is to send all of your bone matrices to the shader. Then each vertex has its bone indices and weights sent as a vertex attribute.

EDIT: adding some helpful references ->