If you have bought my book “Building a Game with Unity and Blender“, you may have realized the sword model shown in Chapter 2 “Creating Characters” is no where to be found in the source files.
Fear not! The sword is actually hidden in Player.blend, which you can unhide by press alt-H in Blender.
Initially I wanted to use the sword model in the game demo. However, eventually I ended up doing punching animation instead of sword-wielding, which is why I hide the sword (instead of deleting it) before moving on to do the animations for Chapter 3.
You can try and unhide the sword, then import it to Unity and parent the sword model to one of the hand bones of the game character. It might even look like sword-wielding when playing the punching animation!
In conjunction with Game Dev Week 2016, some of books at Packt Publishing that are related to game development are now half of the original price, including the book I wrote, “Building a Game with Unity and Blender“! Click on the banner below to check out the promotion.
UPDATE: This program is now known as Easy Screencap and has been moved to here
Recently I created a simple program for a client. They’re working on a project for a theme park whereby an animated video showing a bunch of penguins running around on an iceberg is being overlayed on top of a webcam video which creates the illusion of penguins running around the visitors. They will then display the final result on a big screen for the visitors to pose and take photos of them with the penguins. This is how it looks like, inside the actual theme park:
Think of it as an augmented reality project without the tracking part, since the webcam is always staying at the same location. My program in-charge of taking screenshots when the operator presses a shortcut key (which you can customize) and the images will be automatically saved to a folder (which you can also customize), each with a unique file name. The folder is then shared with the printer’s computer through local network and visitors can pick which photos (screenshots) they want to buy so the printer will print it out for them. Profit.
This is how my program looks like:
Since this is a really simple program which doesn’t do much other than taking fullscreen screenshots, I decided to release it for free and call it “Easy Screenshot 1.0”. You can set the shortcut key (doesn’t support ctrl, shift and alt at the moment) and the name of the output folder.
Once you’re done with that, press the ‘Start’ button and you can now minimize the program as it will continue to track the keyboard events in the background. Whenever you press the shortcut key, a screenshot will be taken silently without any message balloon popping out.
You can download Easy Screenshot 1.0 for free, by clicking the button below:
I did OpenGL eons ago when fixed-function pipeline was still pretty much the industry standard and most computers were still not capable of running flashy shaders at the time. However, things have changed a lot for the past few years – GPUs are getting more powerful and almost every home computer and even mobile phones are capable of running shader-heavy games. Both DirectX and OpenGL are even abandoning the fixed-function pipeline (although it still exists in the realm of compatibility profile) so that got me thinking – should I start learning that as well?
I’ve been using shaders in game engines but never in raw OpenGL. It’s quite a different experience dealing with VBO and VAO compare to the good old glBegin, glVertex3f, etc. I decided to use OpenGL with Qt because in my opinion it’s very convenient when comes to managing window events and inputs. Qt is, in-fact, more than just a window manager, it also provides a ton of helper classes which make my life easier, so why not.
I spent few days in re-learning the modern OpenGL and created a simple demo that loads an OBJ model and displays it on the screen:
The “Hello World” text appearing at the upper left corner of the window was drawn using Qt’s QPainter class which looks like this:
Just 3 lines of code! As you see, with Qt, I don’t have to re-invent my own font loader and renderer which is a pain in the arse. Qt is really powerful and can be easily integrated with OpenGL. I think I should consider making this into a game engine just for fun.
Recently, a reader sent me the following screenshot which shows a corrupted scene from my book’s demo project.
He also showed me the errors and warning he get when running the demo project:
Lightmap snapshot ‘LightmapSnapshot’ is inconsistent – 62 files out of 248 are missing. Realtime GI will be disabled. Please rebuild lighting for this scene.
Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 600, VertexCount: 11191
Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 96, VertexCount: 11191
This happens when Unity tries to convert the demo project to the latest version, which sometimes might mess up the files.
To solve this issue, reimport the mesh which has been corrupted by the conversion (in this case, terrain and rocks) by right clicking on the asset in Unity and choose “Reimport”, or delete the prefabs from the scene and place it again manually.
Once you have done the steps above, re-bake the lighting again and everything will work fine.