PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: TextureCreatorHorizonMap3D.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLRENDERER_TEXTURECREATOR_HORIZONMAP3D_H__ 00024 #define __PLRENDERER_TEXTURECREATOR_HORIZONMAP3D_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLRenderer/Texture/Creator/TextureCreator.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLRenderer { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * 3D horizon map texture (TextureBuffer::L8) creator class 00046 * 00047 * @note 00048 * - This 3D horizon map texture can be used within shader programs for self shadowing. 00049 * For more information about this have a look at "Interactive Horizon Mapping". 00050 * (http://research.microsoft.com/~cohen/bs.pdf) 00051 * - The creation of horizons map shouldn't done at runtime because it's not 00052 * performant! 00053 */ 00054 class TextureCreatorHorizonMap3D : public TextureCreator { 00055 00056 00057 //[-------------------------------------------------------] 00058 //[ RTTI interface ] 00059 //[-------------------------------------------------------] 00060 pl_class(PLRENDERER_RTTI_EXPORT, TextureCreatorHorizonMap3D, "PLRenderer", PLRenderer::TextureCreator, "3D horizon map texture (TextureBuffer::L8) creator class") 00061 // Attributes 00062 pl_attribute(Filename2D, PLCore::String, "", ReadWrite, DirectValue, "2D height map filename to create the horizon map for", "") 00063 pl_attribute(XSize, PLCore::uint32, 64, ReadWrite, DirectValue, "Texture x size (must be a power of 2)", "Min='8'") 00064 pl_attribute(YSize, PLCore::uint32, 64, ReadWrite, DirectValue, "Texture y size (must be a power of 2)", "Min='8'") 00065 pl_attribute(ZSize, PLCore::uint32, 64, ReadWrite, DirectValue, "Texture z size (must be a power of 2)", "Min='8'") 00066 pl_attribute(Height, float, 0.16f, ReadWrite, DirectValue, "Height", "") 00067 // Constructors 00068 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00069 pl_class_end 00070 00071 00072 //[-------------------------------------------------------] 00073 //[ Public functions ] 00074 //[-------------------------------------------------------] 00075 public: 00076 /** 00077 * @brief 00078 * Default constructor 00079 */ 00080 PLRENDERER_API TextureCreatorHorizonMap3D(); 00081 00082 /** 00083 * @brief 00084 * Destructor 00085 */ 00086 PLRENDERER_API virtual ~TextureCreatorHorizonMap3D(); 00087 00088 00089 //[-------------------------------------------------------] 00090 //[ Private virtual TextureCreator functions ] 00091 //[-------------------------------------------------------] 00092 private: 00093 virtual Texture *Create(TextureManager &cTextureManager, Texture *pTexture = nullptr) const override; 00094 00095 00096 }; 00097 00098 00099 //[-------------------------------------------------------] 00100 //[ Namespace ] 00101 //[-------------------------------------------------------] 00102 } // PLRenderer 00103 00104 00105 #endif // __PLRENDERER_TEXTURECREATOR_HORIZONMAP3D_H__
|