Jump to content

  • Log In with Google      Sign In   
  • Create Account

L. Spiro

Member Since 29 Oct 2003
Offline Last Active Today, 07:17 AM

Posts I've Made

In Topic: Scene System?

21 July 2016 - 02:08 AM

It's job is also to handle the transformation hierarchies of objects and the camera.

This is not the scene manager’s job; the scene graph is an implicit nature of the actors in the scene.
Actors themselves can be parents and children of other actors. Actors themselves manage how a parent transform affects their own transforms, etc.

The scene manager will issue a “pre-update” call to each actor, which actors can use to calculate their final transforms taking their local transforms with their parents’ transforms, but to the scene manager this call is a black box. The actors could use it to make spaghetti for all the scene manager cares.



In addition to what has already been said, I would point out that there is no reason to restrict yourself to having only a single scene at a time.
I real-life example that I had where 2 scenes would be the best solution was in a golf game I made in which you spend most of your time on the 3D field, but for swinging the club the golf course is shrunken to fit a certain area of the screen and a 3D guy swinging a club is overlaid on top of it with a different set of projections and view transforms.



Render-queues are a good way to sort objects for rendering inside a single scene, but if we are talking about overlaying the UI, debug text, etc., then you would really want layers.
Usually engines have a fixed and predefined set of layers, each intended to render a specific part of the scene.
Usually there are about 16 layers, but most of them are blank or “reserved” for future use.
An example of a simple set of layers would be:
Layer 0: Player.
Layer 3: Solid 3D objects.
Layer 5: Terrain.
Layer 7: Skybox.
Layer 8: Translucent 3D objects.
Layer 10: Post processing.
Layer 12: UI/HUD.
Layer 15: Debug text.


Layers are drawn in order, so later layers are drawn on top of earlier layers.
The way each layer is drawn is custom. The 3D layers would use render queues, but the terrain layer would use a system specific to terrain (chunks, GeoMipmaps, etc.), and the skybox layer would just be a single standard draw call.



  • Redrawing the entire scene from scratch is very slow
Too bad. That is what you do. If it is slow, it is probably because you are using glBegin() etc., and are otherwise non-optimal.
The solution isn’t to try redrawing only what has changed, the solution is to fix the actual bottlenecks.

The idea is that the scene system would accept requests to have things drawn, either once (during the next frame), or until the drawn object's lifetime runs out (i.e. next N frames).

Issue calls on a per-frame basis. Never assume anything about any future Nth frame. You don’t know when the player is going to hit the button to go to the next stage and all your assets need to be unloaded or exchanged.


L. Spiro

In Topic: No Raw Input Key Up If I Press The Key Fast Enough?

19 July 2016 - 01:50 AM

If you are detecting events at the message-pump level, any missing events will be the result of buggy code.  This should not happen otherwise.

If you are missing events further down the pipeline, such as in the game loop, then it is an error with how you log and track key events.  Because you said that keys get stuck, it seems more likely to be something related to the message pump.

 

Ensure that you process all waiting messages before continuing with the game loop and that you never discard any messages.

You can check to see if it is a bug with the keyboard driver by seeing if the same problem can be replicated in any other program, such as Notepad.  If not, then it is specifically related to how you process messages.

 

 

L. Spiro


In Topic: And the Best President for America is…

14 April 2016 - 07:27 AM

Jesus Spiro, dial it back a notch.

I had some steam to release. You can always be sure that there is a good reason for any irrational thing I say.

You could have been sure of that.
I have no job and am already $3,000 in debt. I have too much pride to ask for donations.
Although I am interviewing and all things look good, I won’t have any form of income for 2 months minimum.

I wanted to move to the UK and marry my fiancé, but that’s not going to happen.
It’s so fucking stupid why it can’t happen. So fucking idiotic.

I am going to be homeless in a few weeks.


I needed that last moment of self-righteousness in order to feel important before I go.
Life’s been great, and I have done so much more than anyone else could imagine.

 

But I lost my motivation over a year ago, and I have just wanted to get it all over with since.

The whole point in moving to the UK was to give life a fresh new scent, but due to unfortunate circumstances I have to forget about the UK and look only towards a life on the streets.

 

I would rather be dead.  Leave my legacy where it is.

 

 

L. Spiro


In Topic: And the Best President for America is…

13 April 2016 - 07:16 AM

To teach America a lesson for its stupidity!!??? That is some real self righteousness there my friend.

It’s an objective reality, and exclusionary to my sense of self. I’m unrelated to the fact that Bernie Sanders is objectively the best candidate. Apparently you think you are more than man since you can proclaim otherwise. You should probably check yourself before proclaiming something as self-righteous.
For me to agree with what is objectively true hardly makes me self-righteous. That’s like saying I am self-righteous for agreeing with gravity.

I am not of America. I observe from afar. I am uninfluenced by any form of politics. I objectively observe and hold no biases.
I vote objectively, not emotionally. I don’t have emotions. Math has determined that Bernie Sanders is the best candidate.
He does the best on domestic economy (as cannot be argued) and has a foreign policy largely akin to, “Stop messing with everyone’s fucking business,” which aligns with what the entire world wants.

During my last 12 years in Thailand, France, Malaysia, South Korea, Laos, Cambodia, England, and Japan, I can assure you that:
#1: Foreign policy is more relevant to…FOREIGNERS.
#2: Foreigners want America to mind its own fucking business. Are you tired of that “WORLD POLICE” meme yet?

Only morons hate on Sanders for a lack of foreign policy. A lack of foreign policy is objectively what the world wants. We’re tired of your shit. Get off our planet.


You have an objectively best candidate during the last 50 years on your plate, and if you don’t vote for him then you deserve to be punished.
I am unrelated. Self-righteousness can’t exist without a self.
You vote for Bernie or you get Trump. The choice is yours.


L. Spiro

In Topic: programming language for android.....

11 April 2016 - 12:41 PM

I can't decide if i will study native language like Obj-C and C++ because I'm worried that maybe this language will no longer exist in the next decade.

Actually your thinking is backwards.
C++ has possibly been around longer than you have been alive (as for me it is only 1 year younger) and will be here long after you are dead.
If you are planning on programming in 10 years, you should be focusing on C++, as it is the only language guaranteed to be here a decade from now.

 

 

L. Spiro


PARTNERS