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 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. […]

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 […]

Chapter 22. Screen resize

When screen size changed, we need to re-position the camera to fit new screen size optimally. For example, in our case optimal scene/”stage” size would be, let’s say, 500×300 (to fit our spinning box into the screen). Our camera’s view angle is 30 degrees. so, ? / 250 = cosine(15) / sine(15) = cotangent(15) ? […]

Chapter 20. Modeler. Curved surfaces

Our current rectangular model does not allow us to appreciate all the beauty of the Phong shader, in particular – the glares. For that we’ll need something more round-shaped. Let’s extend our Modeler accordingly. Windows 1. Start VS. Open C:\CPP\a997modeler\p_windows\p_windows.sln. First – we’ll need to extend VirtualShape.h. 2. Open VirtualShape.h and replace code by: New […]