Life: More pics

You asked for more baby pictures (ok, maybe not YOU, but somebody else did, honest!) so here they are:

Aaron with his baby sister.
Big brother Aaron with little sister Adriana

Chubby cheeked Adriana relaxes...
adriana on the sofa

Adriana, after her baby blessing, Sunday.
Adriana's first church service

jME: contexts

This past weekend I spent some time trying to figure out why I couldn't use water and bloom and terrain together. Basically I was getting artifacts and odd behavior all over the place. Finally I realized the problem was due to context switching.

OpenGL is a state machine. Once you set a state on it - for example, "all things drawn should have this texture" - that's how it will behave until you tell it otherwise. Changing state can be expensive, so we take advantage of this property of OpenGL by not making state changes if we think that state is already the way we want it. Sounds good right?

Well, it is until you throw in the idea of context. In a simple situation, you are rendering in a single context (an off screen buffer usually) but in more complex situations, you might render to multiple buffers and combine the results. Each of these buffers may be its own context, wherein state is individually tracked. Suddenly, code that only understands single context situations is horribly confused.

For the moment, I've implemented a clearing of most (hopefully all) of the places we keep track of current state whenever we change context, but hopefully soon I will begin work on a context/state tracking system that will allow jME to smartly track and react to changes in context appropriately.

Stay tuned.

jME: Applet Support

Over the last two weeks or so, Mark and I have worked closely with the folks at lwjgl to get Java Applet support into jME. Since we did this at work, we weren't able to immediately contribute it back to the community, but yesterday we were finally granted permission to do so. The lwjgl guys really did all the heavy lifting (thanks guys!) getting the support into lwjgl itself. In the meantime, Mark got lwjgl to build locally to do testing, I put together some SimpleGame type base classes for applets and added additional support to our AWT classes and we both yelled when we found bugs.

Anyhow, pull it down from cvs and get started on your applets today. There's a decent set of instructions on how to proceed on our wiki.

Life: Adriana

Yesterday at 5:38pm we were blessed with our second child, a baby girl. She was 8 lbs 11 oz and 20.5 inches long. We've named her Adriana Rose Slack. Everyone say hi. :)

Baby Adriana

Jeni is doing well and looking beautiful as always. As you can see, Adriana's big brother Aaron is pretty excited about his baby sister.

mommy and her two kids Adriana and Aaron

And here's a picture with daddy in it too.

Josh, Jeni and baby Adriana

I'm hoping mom and baby will both be home tomorrow. The doctor tells us she has an irregular heart-beat though so we're praying everything will go alright. I'll know more tomorrow.

Life: Broken Windows

Evidently my dining room window pissed someone off last night around 3:30am. I tried to get the story from it, but it was all broken up. When I remarked it didn't look so hot, it just shrugged the way windows do and said "yeah, but you should see the other guy!"

what now??

Life: Postponed!

I was supposed to be a dad all over again today but they told us the hospital was too full. So, after a series of delays we have now been told that Friday the 14th at 6am is going to be the magic day. We'll see...

jME: Prize Monkeys

For those of you thinking about entering future jME contests like our recent vegetation contest, maybe a picture of the official plush prize monkies will nudge you into action.

the prize monkies!

They come in two colors, so even if you win once, you need to enter again so you can complete the pair!

Playing with fire

Last week we enjoyed our first fourth of July living in a place that allows your ordinary citizen to find, obtain and use fireworks without going to jail. Needless to say, we made sure we took full advantage of the situation. For only $20 we were able to put together a small arsenal of rockets and sparklers which we pooled together with the neighborhood for a spectacular evening of fun.

I'm definitely loving it in Texas. :)

aaron holding a sparkler
(son Aaron with sparkler)

jME: Movies are coming!

The ability to load movies in jME is coming soon to a cvs near you. Many people have asked for this and some attempts to do it with 3rd party packages such as jmf have been done to varying degrees of success. But I've always wanted to see some kind of native support (no extra libraries needed) in jME for playing movies to a texture. After reading up on Id software's Quake3 movie format called RoQ (also used in other games such as American McGee's Alice) I decided it was simple enough to start off with. You can read up on the format and find some related C code over at the website of Dr. Tim Ferguson. I used his work heavily to learn the file format. My implementation makes good use of nio and memory mapped files, bringing the loading and parsing time of the files to less than 12ms per frame on my machine (p4 3.2GHz.)

Here are a few screenshots of my loader code in action running the demo movie from the Alice demo:
RoQ on a cube 1
RoQ on a cube 2
RoQ on a cube 3

I'm now working on loading audio from the format as well as making a generic API around the code so we can write conversion tools for other formats as well. Stay tuned for more!

Firefly effect

Catching up on some older news here. I spent some time with a few good books on Game Artificial Intelligence a week ago. The first one is Mat Buckland's "Programming Game AI by Example" the others are part of the "AI Game Programming Wisdom" series. AI has always fascinated me from my earliest programming days sitting in front of the Vic20 or Apple 2+ and as I have been monkeying around with particle systems in the jMonkeyEngine I thought I'd see if I could apply AI to particles.

The first and most obvious application to me was the classic flocking (aka "boids") demo. In flocking, each unit (a particle in this case) scans the units within a certain proximity and adjusts its velocity to A. try to head in the average heading of its neighbors B. try to maintain a certain distance from its neighbors and C. try to move towards the "center of mass" of its neighbors. Doing all 3 at once can be a little computationally expensive with large numbers of particle - but doable.

Doing a little more reading though I came across a similar effect that's much cheaper because it does not do neighbor checking. In this effect, called swarm, a center point in space is given as your focal point. The gist of the technique is checking each unit's velocity to ensure it is heading towards that focal point (plus or minus a configurable angle amount) if it is not, the unit's velocity is turned over time (again configurable) towards that focal point. Further touches include having an inner and an outer zone and changing the behavior based on which zone it is in (so if the unit is far away it heads straight for the point, if it is in close, it rotates about the point.)

shot of the swarm test in action

You can see how I've implemented this effect as a ParticleInfluence in jMonkeyEngine's cvs by combing through the source for com.jmex.effects.particles.SwarmInfluence. A test showing it in action is also in there called jmetest.effects.TestParticleSwarm or you can play with it via the RenParticleEditor.

On a lighter note

Our baby girl is likely to arrive sometime in the next ten days instead of three weeks from now! Our last sonogram showed her at 8lbs already, and since Aaron was a whopping 10lbs 9 ounces, we're looking at inducing. Hopefully we'll get our schedule soon. The name we've chosen is Adrianna.

Where to vent?

What's frustrating about this blog is the restrictions I often feel when posting. I can't really talk about what's really interesting to me, for example, without wondering if someone at work is reading it too and thinking I have too much free time on my hands. :)

Speaking of work, I'd also like to talk about the accomplishments I've been making there. But then, I don't really know what is "secret" information and what is "safe" for dissemination. So that's usually off limits too.

Another restriction I feel is on my desire to air out my daily stress. Unfortunately, writing out the things that rip at my heart and psyche is just likely to cause additional negative affects. So the question I have is where do you vent? If someone is continuously antagonistic towards you, purposely or not, or if you feel alone or without friends, where do you say so and get it off your chest? If someone snubs your opinion at every turn, where do you push back to stop it? If you feel like life events are a heavy burden, where can you put it down and rest for a moment?

My personality is to confront and try to work things out directly. If I feel a person is unhappy with me, frustrated, or even disdainful, I will try to call them out on it and patch it up. Unfortunately, that seems to only work half the time, with other results being either no change at all or simply making things worse. Besides, in many cases things have no clear "other person" to confront.

I suppose there is no one answer to these things. Once upon a time, long ago, I would write poetry and even novels (I think I mentioned once here in my blog that the name "Renanse" came from one of those novels?) to explore and vet my thoughts. Maybe I need to get back to doing it that way...