Now I want to make gilded blazon and "Marlboro" sign on the front embossed. For this we'll use Normal Maps. That's a bluish images on the right: To burn them I used NormalMap-Online website. Default settings are for DirectX. For OpenGL - checkmark Invert R Click on the left picture to upload your own. You […]
Chapter 30. Vertex group manipulations
Here I want to add gilded (golden) prints on the pack. For this we will need a way to modify projection's size and position (initially defined by VirtualShape). Our new root01.txt will be: 1. Copy this code to a Text Editor and save it (overwrite) to/as C:\CPP\a997modeler\dt\models\misc\marlboro01\root01.txt Please note: In previous samples we used gold01.bmp texture. But […]
Chapter 29. Chroma key
Chroma keying, obviously, is a way of treating certain color as transparent one. In our case - green: Of course, after loading an image, before pushing it to a texture, we can easily scan it for green pixels and set their Alpha-channels to zero. But when GL rasterizer picks tUV coordinates near the green areas, […]
Chapter 28. Model Loader
Our next goal is to move model building process out of TheGame class. We will need some kind of models text descriptor, XML format seems quite suitable. We will keep models descriptions outside of executable, in /dt folder. Then we'll need a class that will load, read and process these descriptors and build actual 3D […]
Chapter 27. Shader groups
Here I want to add "reflection" and "over mask" shaders, each of which will double number of shader-programs. Correspondingly, we'll need a function which will load a group of shaders in 1 shot (for example - Phong or flat for different data feeds). Also, we'll need a function that will pick particular shader number depending […]
Chapter 26. Render to and read from GL texture
Here I want to render a bit more complicated white noise images. I want bigger dots with a soft transition between them. The task splits in following steps: Generate initial black/white image (as we did in previous chapter) Generate a GL texture out of it Make it renderable (associate a render buffer with it) Force […]
Chapter 25. Writing BMP and TGA files
I was planning to generate and save a few "white noise" images for future use in some recognizable graphics format. In order not to overload the project by new heavy libraries, I decided to write own little function. For the sake of simplicity I won't use compression and will support only 1 pixel format - […]
Chapter 24. Synchronization
Right now on both my devices (Android and PC) the box makes 1 revolution in approximately 4 seconds. It's 360 frames (rotation speed is set to 1 degree per frame). This means 360/4=90 frames per second (FPS). Obviously, on another devices it can be different. Besides, speed can depend on background processes and other factors. […]
Chapter 23. #ifdef in shaders
Right now we have 6 shaders (3 vertex+fragment pairs), which generate 3 shader-programs. Now we need to add textured Phong shader, then we'll need color or texture over transparency mask for both flat and phong cases, which will double number of shaders, and so on, and soon it will be hard to manage them all. […]
Video. DaVinci Resolve
I reached the point in my blog where I had to share not just a screenshot, but video. This task splits in a few steps: 1. Capturing the video So, I have an animation on my screen, which I want to record/capture. Windows 10 offers a Capture Utility to record your display. It's a part […]