~ubuntu-branches/ubuntu/quantal/aqsis/quantal

« back to all changes in this revision

Viewing changes to libs/tex/filtering/shadowsampler.h

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-08-06 04:53:26 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090806045326-z6xeaaao62idxcc6
Tags: 1.6.0-0ubuntu1
* New upstream release
* debian/control:
  - changed name of lib package to libaqsis1 instead of aqsis-libsc2a
  - changed name of dev package to libaqsis-dev instead of aqsis-libs-dev
  - Added aqsis-data package
  - Revised summary text according to that specified by the RISpec (Pixar)
* Moved examples installation from aqsis.install to aqsis-data.install
* debian/rules: 
  - added content to binary-indep target
* debian/rules: added explicit name of mime file to force dh_installmime
  to generate postinst and prerm scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Aqsis
 
2
// Copyright (C) 1997 - 2007, Paul C. Gregory
 
3
//
 
4
// Contact: pgregory@aqsis.org
 
5
//
 
6
// This library is free software; you can redistribute it and/or
 
7
// modify it under the terms of the GNU General Public
 
8
// License as published by the Free Software Foundation; either
 
9
// version 2 of the License, or (at your option) any later version.
 
10
//
 
11
// This library is distributed in the hope that it will be useful,
 
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
// General Public License for more details.
 
15
//
 
16
// You should have received a copy of the GNU General Public
 
17
// License along with this library; if not, write to the Free Software
 
18
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 
 
20
/** \file
 
21
 *
 
22
 * \brief Shadow texture sampler.
 
23
 *
 
24
 * \author Chris Foster [ chris42f (at) gmail (dot) com ]
 
25
 */
 
26
 
 
27
#ifndef SHADOWSAMPLER_H_INCLUDED
 
28
#define SHADOWSAMPLER_H_INCLUDED
 
29
 
 
30
#include <aqsis/aqsis.h>
 
31
 
 
32
#include <aqsis/tex/filtering/ishadowsampler.h>
 
33
#include <aqsis/math/matrix.h>
 
34
#include <aqsis/tex/filtering/texturesampleoptions.h>
 
35
 
 
36
namespace Aqsis
 
37
{
 
38
 
 
39
template<typename>
 
40
class CqTileArray;
 
41
 
 
42
//------------------------------------------------------------------------------
 
43
/** \brief A sampler for shadow maps, implementing percentage closer filtering.
 
44
 */
 
45
class AQSIS_TEX_SHARE CqShadowSampler : public IqShadowSampler
 
46
{
 
47
        public:
 
48
                /** \brief Construct a shadow sampler with data from the provided file.
 
49
                 *
 
50
                 * \param file - file to obtain the shadow map data from.
 
51
                 * \param currToWorld - a matrix transforming the "current" coordinate
 
52
                 *                      system to the world coordinate system.  Sample
 
53
                 *                      quads are assumed to be passed to the sample()
 
54
                 *                      function represented in the "current"
 
55
                 *                      coordinate system.
 
56
                 */
 
57
                CqShadowSampler(const boost::shared_ptr<IqTiledTexInputFile>& file,
 
58
                                const CqMatrix& currToWorld);
 
59
 
 
60
                // inherited
 
61
                virtual void sample(const Sq3DSampleQuad& sampleQuad,
 
62
                                const CqShadowSampleOptions& sampleOpts, TqFloat* outSamps) const;
 
63
                virtual const CqShadowSampleOptions& defaultSampleOptions() const;
 
64
        private:
 
65
                /// transformation: current -> light coordinates
 
66
                CqMatrix m_currToLight;
 
67
                /// transformation: current -> raster coordinates ( [0,1]x[0,1] )
 
68
                CqMatrix m_currToTexture;
 
69
                /// Pixel data for shadow map.
 
70
                boost::shared_ptr<CqTileArray<TqFloat> > m_pixelBuf;
 
71
                /// Default shadow sampling options.
 
72
                CqShadowSampleOptions m_defaultSampleOptions;
 
73
};
 
74
 
 
75
 
 
76
} // namespace Aqsis
 
77
 
 
78
#endif // SHADOWSAMPLER_H_INCLUDED