Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Mar 2013
Offline Last Active Today, 11:50 AM

Posts I've Made

In Topic: what means these error?

20 June 2016 - 02:12 PM

Hello Cambalinho,


it has been awhile since I received a similar error, so I had to do a little bit of research. The general consensus is that the error is given when attempting to access a pointer that has either not been properly initialized, or has been deleted. Essentially trying to de-reference a dangling pointer that may point to an unexpected area in memory. If my explanation proves to be insufficient, i'll attempt to clarify, or through a google search you will be able to procure a wealth of info in regards to this particular error.


Might also be helpful to post the source file(s) that is generating the errors.


Marcus Hansen

In Topic: How to avoid Singletons/global variables

15 June 2016 - 08:27 AM

I always love practical examples.


void SomeFunc() //This function requires no argument. So it appears to be relatively standalone


    mySingletonClass* mySingletonClass::getSingletonObject() //Oh, you evil sob

    //does something




If the project is small as others have stated, AND you, and/or one other guy are they only developers touching the code. A singleton could be justified. But take a look at that function. How am I, as a curious passerby in the project know what in god's name the function truly requires for it's functionality? I have come across several times in production code, and more often than not it tends to be a show stopper. 


Avoid them, even if your the only one working on a project. For all you know someone may come by in the future, and need to work on it. Besides though singletons can make code look cleaner, it actually shows extremely bad foresight, and the inability to nail down a coherent, and non-opaque object/function design.


Marcus Hansen

In Topic: Why is it so hard to do animations?

09 June 2016 - 10:28 PM

As Karsten eluded to. Vertex tweening is an option when the format you are utilizing for your meshes does not natively support animations. Though to my knowledge it's a bit more memory intensive depending on the complexity of the mesh, however, it is quite simple to implement.


Blender does support the rigging of a model, and the exportation of an obj model as "parts" which is essentially just an output of the obj files for the individual key-frames. You then utilize delta time to interpolate the current mesh vertices which lay somewhere between the two key-frames (depending on the delta) creating an animation. Though simple in it's premise several games have, and still do use this method. 


From what I understand (could be mistaken) morph targets are still used in several AAA titles for the animation of character faces. The biggest caveat to this animation method though is to be entirely sure that your vertice topology for each keyframe of the mesh is consistent after, and during the exportation of the mesh. Failure to do so will likely cause tearing in the mesh during animation, and other oddities.


When exporting a obj model blender provides two check boxes in it's more recent iterations. One is for "animation", and the other is "keep vertex order". The latter being very important as the obj exporter will likely optimize the underlying vertice layout per animation export, creating at a low level what are dissimilar meshes. When performing tweening not keeping this in mind is not conducive for a good time.


In conclusion I wouldn't say it's hard to do animations. It can just become very involved depending how complex you wanna make your animation subsystem, much like everything else in software development. It requires knowing the basics of the format you are using, and to avoid the common pitfalls that each format has to offer, and of course the normal software development aspects of it as well.


I'll include the pictures for the blender export options:







In Topic: What is this artifact in my shadow map?

17 May 2016 - 11:19 AM

Two thoughts come to mind.


Have you tried playing around with the bias? Tweaking it until the issue is not visible on the geometry?

Also, are you using a nullified Sampler State, or did you specify a clamped sampler?


Marcus Hansen

In Topic: XNA Width And Height Problem

06 May 2016 - 11:32 AM

To further elaborate on nscu121978's answer.


"If you request a back-buffer resolution that is not supported by the output device, the XNA Framework automatically selects the highest resolution supported by the output device. For example, if a graphics back buffer with a resolution of 1920×1080 (1080p or 1080i) is created and displayed on a device with 480i resolution, the back buffer automatically is resized to 480i."




This is verbatim from the MSDN website on the use of preferredBackBufferWidth & Height.

Also, it seems there's a general consensus that the ApplyChanges Method should only be called within the update method of your game class, not entirely sure that it matters, but it's worth a shot.


Marcus Hansen