3131
3232namespace IBLUtilities
3333{
34- void GenerateIrradianceMap (GFXTextureTargetRef renderTarget, GFXCubemapHandle cubemap, GFXCubemapHandle &cubemapOut)
34+ void GenerateIrradianceMap (GFXTextureTargetRef renderTarget, GFXTexHandle cubemap, GFXTexHandle &cubemapOut)
3535 {
3636 GFXTransformSaver saver;
3737
@@ -65,11 +65,11 @@ namespace IBLUtilities
6565 GFX->setShaderConstBuffer (irrConsts);
6666 GFX->setStateBlock (irrStateBlock);
6767 GFX->setVertexBuffer (NULL );
68- GFX->setCubeTexture (0 , cubemap);
68+ GFX->setTexture (0 , cubemap);
6969
7070 for (U32 i = 0 ; i < 6 ; i++)
7171 {
72- renderTarget->attachTexture (GFXTextureTarget::Color0, cubemapOut, i);
72+ renderTarget->attachTexture (GFXTextureTarget::Color0, cubemapOut, 0 , 0 , i);
7373 irrConsts->setSafe (irrFaceSC, (S32)i);
7474 GFX->setActiveRenderTarget (renderTarget);
7575 GFX->clear (GFXClearTarget, LinearColorF::BLACK, 1 .0f , 0 );
@@ -80,7 +80,7 @@ namespace IBLUtilities
8080 GFX->popActiveRenderTarget ();
8181 }
8282
83- void GenerateAndSaveIrradianceMap (String outputPath, S32 resolution, GFXCubemapHandle cubemap, GFXCubemapHandle &cubemapOut)
83+ void GenerateAndSaveIrradianceMap (String outputPath, S32 resolution, GFXTexHandle cubemap, GFXTexHandle &cubemapOut)
8484 {
8585 if (outputPath.isEmpty ())
8686 {
@@ -101,7 +101,7 @@ namespace IBLUtilities
101101 }
102102 }
103103
104- void SaveCubeMap (String outputPath, GFXCubemapHandle &cubemap)
104+ void SaveCubeMap (String outputPath, GFXTexHandle &cubemap)
105105 {
106106 if (outputPath.isEmpty ())
107107 {
@@ -118,7 +118,7 @@ namespace IBLUtilities
118118 }
119119 }
120120
121- void GeneratePrefilterMap (GFXTextureTargetRef renderTarget, GFXCubemapHandle cubemap, U32 mipLevels, GFXCubemapHandle &cubemapOut)
121+ void GeneratePrefilterMap (GFXTextureTargetRef renderTarget, GFXTexHandle cubemap, U32 mipLevels, GFXTexHandle &cubemapOut)
122122 {
123123 GFXTransformSaver saver;
124124
@@ -153,9 +153,9 @@ namespace IBLUtilities
153153 GFX->pushActiveRenderTarget ();
154154 GFX->setShader (prefilterShader);
155155 GFX->setShaderConstBuffer (prefilterConsts);
156- GFX->setCubeTexture (0 , cubemap);
156+ GFX->setTexture (0 , cubemap);
157157
158- U32 prefilterSize = cubemapOut->getSize ();
158+ U32 prefilterSize = cubemapOut->getWidth ();
159159
160160 U32 resolutionSize = prefilterSize;
161161
@@ -171,7 +171,7 @@ namespace IBLUtilities
171171 prefilterConsts->setSafe (prefilterRoughnessSC, roughness);
172172 prefilterConsts->setSafe (prefilterMipSizeSC, mipSize);
173173 U32 size = prefilterSize * mPow (0 .5f , mip);
174- renderTarget->attachTexture (GFXTextureTarget::Color0, cubemapOut, face);
174+ renderTarget->attachTexture (GFXTextureTarget::Color0, cubemapOut, 0 , 0 , face);
175175 GFX->setActiveRenderTarget (renderTarget, false );// we set the viewport ourselves
176176 GFX->setViewport (RectI (0 , 0 , size, size));
177177 GFX->clear (GFXClearTarget, LinearColorF::BLACK, 1 .0f , 0 );
@@ -183,7 +183,7 @@ namespace IBLUtilities
183183 GFX->popActiveRenderTarget ();
184184 }
185185
186- void GenerateAndSavePrefilterMap (String outputPath, S32 resolution, GFXCubemapHandle cubemap, U32 mipLevels, GFXCubemapHandle &cubemapOut)
186+ void GenerateAndSavePrefilterMap (String outputPath, S32 resolution, GFXTexHandle cubemap, U32 mipLevels, GFXTexHandle &cubemapOut)
187187 {
188188 if (outputPath.isEmpty ())
189189 {
@@ -504,7 +504,7 @@ namespace IBLUtilities
504504 // SH Calculations
505505 // From http://sunandblackcat.com/tipFullView.php?l=eng&topicid=32&topic=Spherical-Harmonics-From-Cube-Texture
506506 // With shader decode logic from https://github.com/nicknikolov/cubemap-sh
507- void calculateSHTerms (GFXCubemapHandle cubemap, LinearColorF SHTerms[9 ], F32 SHConstants[5 ])
507+ void calculateSHTerms (GFXTexHandle cubemap, LinearColorF SHTerms[9 ], F32 SHConstants[5 ])
508508 {
509509 if (!cubemap)
510510 return ;
@@ -525,7 +525,7 @@ namespace IBLUtilities
525525 VectorF (0 .0f , 0 .0f , -1 .0f ),
526526 };
527527
528- U32 cubemapResolution = cubemap->getSize ();
528+ U32 cubemapResolution = cubemap->getWidth ();
529529
530530 GBitmap* cubeFaceBitmaps[6 ];
531531
0 commit comments