Jump to content

  • Log In with Google      Sign In   
  • Create Account

L. Spiro

Member Since 29 Oct 2003
Offline Last Active Today, 06:38 AM

Posts I've Made

In Topic: Textured cube with glDrawElements

23 January 2015 - 03:44 AM

If 2 vertices have the same values for their positions, normals, UV’s, etc., then you can merge them into 1 vertex.
If not, then you can’t.

It is as simple as that. If your points are the same but your UV’s are not, then your vertices are not duplicates, period.

L. Spiro

In Topic: Would this be considered duplicate code?

22 January 2015 - 09:57 PM

“state == ActionState.RUNNING” is certainly duplicate.
I have to go or else I would mention more, but a very quick rewrite:
if ( state == ActionState.RUNNING ) {
	bool bIdle = false;
	// switch/case also possible.
	if ( direction == Direction.RIGHT ) {
		if ( rightReleased ) {
			bIdle = true;
	else if ( direction == Direction.LEFT ) {
		if ( leftReleased ) {
			bIdle = true;
	// …
	if ( bIdle ) {
		state = ActionState.IDLE;

L. Spiro

In Topic: Current-Gen Lighting

22 January 2015 - 08:12 PM

I wrote a lengthy reply as well but had to reboot.


tri-Ace released a physically based model of Blinn-Phong which is simple and efficient.


As well as a more efficient and accurate Oren-Nayar.




L. Spiro

In Topic: Possible shadow artifact on the caster in a ray-tracer.

22 January 2015 - 07:48 PM

#1: “Ain’t” isn’t a word.

#2: Your reflections are correct.  Why would the bottom of the sphere be reflecting straight down into the shadow?  The bottom of the sphere from any perspective bounces light from that perspective almost entirely straight (almost the same direction as the incoming ray).  This is true all around the entire edge of the sphere as viewed from any direction.


Unless you position your view such that the shadow is directly behind the bottom of the sphere (from your view’s perspective), you won’t have the bottom of the sphere reflecting the shadow.



L. Spiro

In Topic: a better fix your timestep?

22 January 2015 - 06:42 PM

Oh, you build games to break.
Why didn’t you say so in the first place? Your method is perfect for you!


perhaps some of my reservations stem from the fact that as a player i've fallen victim to f-y-t's frame dropping, and its ruined more than one evening's worth of gaming over the years.

You don’t even understand what fixed time-steps are, yet you are able to see a problem in a game you didn’t even make and visually track it down to a fixed time-step?

i guess as long as i don't need deterministic playback, don't use physics that can blow up, and stick with single player, f-y-t is just overkill for me.

And as long as players can’t stand on moving things, or lock the camera onto moving things, then yes, interpolating 2 vectors and a quaternion between the last 2 updates is definitely overkill.
“Sorry players. I don’t want to interpolate between 2 vectors and a quaternion, so here is a game that is single-player only, non-deterministic (meaning you can’t have fun TAS’ing them), has no playback support, doesn’t allow you to stand on anything that might move, and doesn’t allow the camera to smoothly follow anything.”

Is it seriously so hard to interpolate between vectors and quaternions?

L. Spiro