Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Member Since 08 Apr 2010
Offline Last Active Yesterday, 02:54 PM

#5077620 Order your draw calls..

Posted by kilah on 14 July 2013 - 11:14 AM

Hi everyone,


Just curious I was reading http://realtimecollisiondetection.net/blog/?p=86 when I decided to think about actually implementing the system as mention, but I faced a dilema. When sorting by key, which includes depth, what depth is that? The centroid of the renderable based on camera position? How do you deal with overlapping objects which centroids are properly sorted? Isn't that a problem? how are you supposed to handle those kind of issues?


In fact I was thinking how does this handles concave objects that wrap other objects within. My first guess was about splitting object into smaller sub meshes and then form the drawcall on the fly by combining those meshes, but seems quite suboptimal.


Any hints would be greatly appreciated, thanks.

#4890468 C++ class question

Posted by kilah on 04 December 2011 - 01:23 PM

No, but you can write a function that does that

I've tried making a function like this:

float* Vec3::get()
	float ret[3] = {x,y,z};
	return ret;

but it still counts as one argument. Am I close at all?

What you are looking for there is:
// x,y and z must be contiguous in memory. In short: have them all three together in your class.
float* Vec3::get()
    return &this->x;

But SirCane solution may be more elegant depending on your point of view.

#4886964 [c++] template magic (template class with member function specialization)

Posted by kilah on 23 November 2011 - 12:32 PM

What you are looking for is partial specialization, not all compilers support it, but it is incresingly common on most used ones. Also you must understand that T may be float, so you would endup with 2 definitions of a single method (forbidden). Therefore in order to avoid that problem, check type_traits which will allow you to "use one or the other based on type of class T".


#4882724 Is Unity3D spoiling me?

Posted by kilah on 10 November 2011 - 02:40 PM

What you aim for? That should be your main concern if you are in learning phase. Is it gameplay developer? is it runtime development? Is it tool development? Do you really know? Depending on your aim Unity is the right tool or not.

For example, if you want to pitch a position as a Physics programmer, creating your own collision solver will impress a way more a technical recruiter than anything you may do on Unity. On the other hand, If you want gameplay programming of any sort, stick with unity, as you will focus your mind on those problem you worry about, and not bother on lower level systems. If you don't have any specific idea on what you want to do, Using unity will always help you to understand the big picture first, which is always a good approach.

My 2 cents.

#4766333 Multitexturing

Posted by kilah on 28 January 2011 - 02:09 PM

You need to upload the multitexture information into the shader. Right now your shader is streaming only the first texture, as you are not linking the shader with any other texture even if you are binding texture from your OGL code (short answer: glUniform to upload texture to bind).