OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
| 3 * |
| 4 * This program is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU General Public License |
| 6 * as published by the Free Software Foundation; either version 2 |
| 7 * of the License, or (at your option) any later version. |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software Foundation, |
| 16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 * |
| 18 * The Original Code is Copyright (C) 2010 Blender Foundation. |
| 19 * All rights reserved. |
| 20 * |
| 21 * The Original Code is: all of this file. |
| 22 * |
| 23 * Contributor(s): none yet. |
| 24 * |
| 25 * ***** END GPL LICENSE BLOCK ***** |
| 26 */ |
| 27 |
| 28 /** \file blender/freestyle/intern/geometry/GridHelpers.cpp |
| 29 * \ingroup freestyle |
| 30 * \brief Class to define a cell grid surrounding the projected image of a scen
e |
| 31 * \author Alexander Beels |
| 32 * \date 2010-12-21 |
| 33 */ |
| 34 |
| 35 #include <math.h> |
| 36 |
| 37 #include "GridHelpers.h" |
| 38 |
| 39 void GridHelpers::getDefaultViewProscenium(real viewProscenium[4]) |
| 40 { |
| 41 // Get proscenium boundary for culling |
| 42 // bufferZone determines the amount by which the area processed should e
xceed the actual image area. |
| 43 // This is intended to avoid visible artifacts generated along the prosc
enium edge. |
| 44 // Perhaps this is no longer needed now that entire view edges are culle
d at once, since that theoretically |
| 45 // should eliminate visible artifacts. |
| 46 // To the extent it is still useful, bufferZone should be put into the U
I as configurable percentage value |
| 47 const real bufferZone = 0.05; |
| 48 // borderZone describes a blank border outside the proscenium, but still
inside the image area. |
| 49 // Only intended for exposing possible artifacts along or outside the pr
oscenium edge during debugging. |
| 50 const real borderZone = 0.0; |
| 51 viewProscenium[0] = freestyle_viewport[2] * (borderZone - bufferZone); |
| 52 viewProscenium[1] = freestyle_viewport[2] * (1.0f - borderZone + bufferZ
one); |
| 53 viewProscenium[2] = freestyle_viewport[3] * (borderZone - bufferZone); |
| 54 viewProscenium[3] = freestyle_viewport[3] * (1.0f - borderZone + bufferZ
one); |
| 55 } |
| 56 |
| 57 GridHelpers::Transform::~Transform () |
| 58 { |
| 59 } |
OLD | NEW |