Suppose you’re drawing a complex three-dimensional picture using depth-buffering to eliminate the hidden surfaces. Suppose further that one part of your picture is composed of coplanar figures A and B, where figure B is a sort of decal that should always appear on top of figure A. Your first approach might be to draw figure B after you’ve drawn ... Read more 11 Sep 2018 - 2 minute read
In ray tracing we need to calculate box normal from ray intersection. Here’s the solution. vec3 BoxNormal(const Box box, const vec3 point) { vec3 center = (box.max + box.min) * 0.5; vec3 size = (box.max - box.min) * 0.5; vec3 pc = point - center; // step(edge,x) : x < edge ? 0 : 1 vec3 normal = vec3(0.0); normal += vec3(sign(pc.x), 0.0... Read more 10 Mar 2018 - less than 1 minute read
Made a program to test intersections: #include <iostream> #include <string> #include <cmath> struct vec3 { vec3(float x) : x(x), y(x), z(x) {} vec3(float x, float y, float z) : x(x), y(y), z(z) {} vec3 operator +(const vec3& v) const { return vec3(x + v.x, y + v.y, z + v.z); } vec3 operator -(const vec3&am... Read more 09 Mar 2018 - 2 minute read
In the far 2007 year I developed an appearance of my own logotype. Now I gonna completely discribe it and make a model in 3DS Max program. Since I don’t have any vector graphics drawing software I gonna use the same program for 2D vector graphics. I defined logotype as two hemitoruses with a torus inside. Let’s start with two circle arcs. \[... Read more 01 Jan 2018 - 2 minute read
Physical based rendering has become a common lighting model for decent engines like Unreal Engine 4, Unity, etc. I’ve found several implementations on the web. And made a simple application based on Shtille Engine framework which allows to test its visual appearance. The PBR material should be UE4-like (consist of 4 textures: albedo map, normal ... Read more 30 Dec 2017 - 1 minute read