2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Authors
|
2023-06-14 23:30:43 +10:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2011-03-14 00:36:27 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup freestyle
|
|
|
|
|
* \brief Class to define a cell grid surrounding the projected image of a scene
|
2012-12-22 18:25:01 +00:00
|
|
|
*/
|
2011-03-14 00:36:27 +00:00
|
|
|
|
|
|
|
|
#include "GridHelpers.h"
|
|
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
namespace Freestyle {
|
|
|
|
|
|
2012-12-22 18:25:01 +00:00
|
|
|
void GridHelpers::getDefaultViewProscenium(real viewProscenium[4])
|
|
|
|
|
{
|
2011-03-14 00:36:27 +00:00
|
|
|
// Get proscenium boundary for culling
|
2019-04-30 17:50:57 +10:00
|
|
|
// bufferZone determines the amount by which the area processed should exceed the actual image
|
|
|
|
|
// area. This is intended to avoid visible artifacts generated along the proscenium edge. Perhaps
|
|
|
|
|
// this is no longer needed now that entire view edges are culled at once, since that
|
|
|
|
|
// theoretically should eliminate visible artifacts. To the extent it is still useful, bufferZone
|
|
|
|
|
// should be put into the UI as configurable percentage value
|
2011-03-14 00:36:27 +00:00
|
|
|
const real bufferZone = 0.05;
|
2012-12-22 18:25:01 +00:00
|
|
|
// borderZone describes a blank border outside the proscenium, but still inside the image area.
|
2019-04-30 17:50:57 +10:00
|
|
|
// Only intended for exposing possible artifacts along or outside the proscenium edge during
|
|
|
|
|
// debugging.
|
2011-03-14 00:36:27 +00:00
|
|
|
const real borderZone = 0.0;
|
2015-11-23 15:31:11 +11:00
|
|
|
viewProscenium[0] = g_freestyle.viewport[2] * (borderZone - bufferZone);
|
|
|
|
|
viewProscenium[1] = g_freestyle.viewport[2] * (1.0f - borderZone + bufferZone);
|
|
|
|
|
viewProscenium[2] = g_freestyle.viewport[3] * (borderZone - bufferZone);
|
|
|
|
|
viewProscenium[3] = g_freestyle.viewport[3] * (1.0f - borderZone + bufferZone);
|
2011-03-14 00:36:27 +00:00
|
|
|
}
|
|
|
|
|
|
2021-04-08 15:51:27 +02:00
|
|
|
GridHelpers::Transform::~Transform() = default;
|
2013-04-09 00:46:49 +00:00
|
|
|
|
|
|
|
|
} /* namespace Freestyle */
|