Chapter 36. "Glass" effect

The model is almost ready. Two remaining missing pieces are: For clear-film we don't even need to write a new shader. We will use our "mirror" shader (as for gilded prints) with white noise as a main texture (uTex0) and will "translate" it to semi-transparent 8x1 texture glass01.bmp (uTex3), imitating glass reflection. It's a plain […]

Chapter 35. "Wire" shader

Here I want to add a golden sealing ribbon on the pack. It will be a line, a sequence of points instead of regular triangulars mesh. It will require: A set of new tags in ModelLoader New lineWidth property in Material class In DrawJob we'll need to adjust lineWidth depending on distance Additional shader's functionality […]

Chapter 34. Adjusting Material

We are STILL trying to "draw" the joint (slit) between the pack and the lid, as a small normal map applied to existing textured mesh's fragment. At this point we do have fragments with their own "native" Materials. In the last sample we just replaced them (Materials) by Phong green. Instead we need to use native Materials, but with added […]

Chapter 33. Polygons Intersection

Just a friendly reminder: we are still trying to "draw" the joint (slit) between the pack and the lid, as a small normal map applied to existing textured mesh's fragment. Like this: In previous chapter we implemented a concept of selecting and manipulating "marked vertices/triangles groups". So, now we can select one (in this sample - "box_right"), duplicate […]

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