Browse Source

Major renaming of texture resources to image resources

Panagiotis Christopoulos Charitos 4 years ago
parent
commit
5d155aa570
64 changed files with 304 additions and 293 deletions
  1. 1 1
      AnKi/Importer/GltfImporter.cpp
  2. 2 2
      AnKi/Renderer/Bloom.cpp
  3. 2 2
      AnKi/Renderer/Bloom.h
  4. 1 1
      AnKi/Renderer/DepthDownscale.h
  5. 1 1
      AnKi/Renderer/Drawer.cpp
  6. 4 4
      AnKi/Renderer/FinalComposite.cpp
  7. 4 4
      AnKi/Renderer/FinalComposite.h
  8. 1 1
      AnKi/Renderer/LensFlare.h
  9. 1 1
      AnKi/Renderer/LightShading.h
  10. 3 3
      AnKi/Renderer/ProbeReflections.h
  11. 2 2
      AnKi/Renderer/RtShadows.cpp
  12. 2 2
      AnKi/Renderer/RtShadows.h
  13. 1 1
      AnKi/Renderer/ShadowMapping.h
  14. 1 1
      AnKi/Renderer/ShadowmapsResolve.h
  15. 3 3
      AnKi/Renderer/Ssao.cpp
  16. 2 2
      AnKi/Renderer/Ssao.h
  17. 1 1
      AnKi/Renderer/Ssgi.cpp
  18. 2 2
      AnKi/Renderer/Ssgi.h
  19. 2 2
      AnKi/Renderer/Ssr.cpp
  20. 1 1
      AnKi/Renderer/Ssr.h
  21. 3 3
      AnKi/Renderer/VolumetricLightingAccumulation.cpp
  22. 1 1
      AnKi/Renderer/VolumetricLightingAccumulation.h
  23. 2 2
      AnKi/Resource.h
  24. 1 1
      AnKi/Resource/ConfigDefs.h
  25. 0 1
      AnKi/Resource/GenericResource.h
  26. 22 22
      AnKi/Resource/ImageAtlasResource.cpp
  27. 24 24
      AnKi/Resource/ImageAtlasResource.h
  28. 1 1
      AnKi/Resource/ImageBinary.h
  29. 1 1
      AnKi/Resource/ImageBinary.xml
  30. 22 22
      AnKi/Resource/ImageLoader.cpp
  31. 16 16
      AnKi/Resource/ImageLoader.h
  32. 11 11
      AnKi/Resource/ImageResource.cpp
  33. 9 9
      AnKi/Resource/ImageResource.h
  34. 2 2
      AnKi/Resource/InstantiationMacros.h
  35. 4 4
      AnKi/Resource/MaterialResource.cpp
  36. 7 7
      AnKi/Resource/MaterialResource.h
  37. 3 3
      AnKi/Resource/ResourceManager.cpp
  38. 3 3
      AnKi/Resource/ResourceManager.h
  39. 6 6
      AnKi/Scene/Components/DecalComponent.cpp
  40. 8 8
      AnKi/Scene/Components/DecalComponent.h
  41. 3 3
      AnKi/Scene/Components/GlobalIlluminationProbeComponent.cpp
  42. 1 1
      AnKi/Scene/Components/GlobalIlluminationProbeComponent.h
  43. 3 3
      AnKi/Scene/Components/GpuParticleEmitterComponent.cpp
  44. 1 1
      AnKi/Scene/Components/GpuParticleEmitterComponent.h
  45. 3 3
      AnKi/Scene/Components/LensFlareComponent.cpp
  46. 8 8
      AnKi/Scene/Components/LensFlareComponent.h
  47. 5 5
      AnKi/Scene/Components/LightComponent.cpp
  48. 2 2
      AnKi/Scene/Components/LightComponent.h
  49. 3 3
      AnKi/Scene/Components/ParticleEmitterComponent.cpp
  50. 1 1
      AnKi/Scene/Components/ParticleEmitterComponent.h
  51. 3 3
      AnKi/Scene/Components/ReflectionProbeComponent.cpp
  52. 1 1
      AnKi/Scene/Components/ReflectionProbeComponent.h
  53. 2 2
      AnKi/Scene/Components/RenderComponent.cpp
  54. 41 41
      AnKi/Script/Scene.cpp
  55. 1 1
      AnKi/Script/Scene.xml
  56. 1 1
      Tools/CMakeLists.txt
  57. 7 0
      Tools/Image/CMakeLists.txt
  58. 0 0
      Tools/Image/ConvertImage.py
  59. 26 14
      Tools/Image/CreateAtlas.py
  60. 0 0
      Tools/Image/ImageImporterMain.cpp
  61. 9 9
      Tools/Image/ImageViewerMain.cpp
  62. 0 0
      Tools/Image/NoiseArray.py
  63. 0 0
      Tools/Image/SegmentImage.py
  64. 0 7
      Tools/Texture/CMakeLists.txt

+ 1 - 1
AnKi/Importer/GltfImporter.cpp

@@ -1258,7 +1258,7 @@ Error GltfImporter::writeLight(const cgltf_node& node, const HashMapAuto<CString
 	if(lensFlaresFname != extras.getEnd())
 	{
 		ANKI_CHECK(m_sceneFile.writeText("lfcomp = node:getSceneNodeBase():getLensFlareComponent()\n"));
-		ANKI_CHECK(m_sceneFile.writeText("lfcomp:loadTextureResource(\"%s\")\n", lensFlaresFname->cstr()));
+		ANKI_CHECK(m_sceneFile.writeText("lfcomp:loadImageResource(\"%s\")\n", lensFlaresFname->cstr()));
 
 		auto lsSpriteSize = extras.find("lens_flare_first_sprite_size");
 		auto lsColor = extras.find("lens_flare_color");

+ 2 - 2
AnKi/Renderer/Bloom.cpp

@@ -76,7 +76,7 @@ Error Bloom::initUpscale(const ConfigSet& config)
 				&& variant->getWorkgroupSizes()[2] == m_workgroupSize[2]);
 
 	// Textures
-	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/LensDirt.ankitex", m_upscale.m_lensDirtTex));
+	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/LensDirt.ankitex", m_upscale.m_lensDirtImage));
 
 	return Error::NONE;
 }
@@ -150,7 +150,7 @@ void Bloom::runUpscaleAndSslf(RenderPassWorkContext& rgraphCtx)
 
 	cmdb->bindSampler(0, 0, m_r->getSamplers().m_trilinearClamp);
 	rgraphCtx.bindColorTexture(0, 1, m_runCtx.m_exposureRt);
-	cmdb->bindTexture(0, 2, m_upscale.m_lensDirtTex->getGrTextureView(), TextureUsageBit::SAMPLED_COMPUTE);
+	cmdb->bindTexture(0, 2, m_upscale.m_lensDirtImage->getTextureView(), TextureUsageBit::SAMPLED_COMPUTE);
 
 	rgraphCtx.bindImage(0, 3, m_runCtx.m_upscaleRt, TextureSubresourceInfo());
 

+ 2 - 2
AnKi/Renderer/Bloom.h

@@ -7,7 +7,7 @@
 
 #include <AnKi/Renderer/RendererObject.h>
 #include <AnKi/Gr.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 
 namespace anki
 {
@@ -84,7 +84,7 @@ private:
 	class
 	{
 	public:
-		TextureResourcePtr m_lensDirtTex;
+		ImageResourcePtr m_lensDirtImage;
 		ShaderProgramResourcePtr m_prog;
 		ShaderProgramPtr m_grProg;
 

+ 1 - 1
AnKi/Renderer/DepthDownscale.h

@@ -7,7 +7,7 @@
 
 #include <AnKi/Renderer/RendererObject.h>
 #include <AnKi/Gr.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 
 namespace anki
 {

+ 1 - 1
AnKi/Renderer/Drawer.cpp

@@ -5,7 +5,7 @@
 
 #include <AnKi/Renderer/Drawer.h>
 #include <AnKi/Renderer/RenderQueue.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Renderer/Renderer.h>
 #include <AnKi/Util/Tracer.h>
 #include <AnKi/Util/Logger.h>

+ 4 - 4
AnKi/Renderer/FinalComposite.cpp

@@ -35,7 +35,7 @@ Error FinalComposite::initInternal(const ConfigSet& config)
 {
 	ANKI_ASSERT("Initializing PPS");
 
-	ANKI_CHECK(loadColorGradingTexture("EngineAssets/DefaultLut.ankitex"));
+	ANKI_CHECK(loadColorGradingTextureImage("EngineAssets/DefaultLut.ankitex"));
 
 	m_fbDescr.m_colorAttachmentCount = 1;
 	m_fbDescr.m_colorAttachments[0].m_loadOperation = AttachmentLoadOperation::DONT_CARE;
@@ -82,7 +82,7 @@ Error FinalComposite::init(const ConfigSet& config)
 	return err;
 }
 
-Error FinalComposite::loadColorGradingTexture(CString filename)
+Error FinalComposite::loadColorGradingTextureImage(CString filename)
 {
 	m_lut.reset(nullptr);
 	ANKI_CHECK(getResourceManager().loadResource(filename, m_lut));
@@ -128,8 +128,8 @@ void FinalComposite::run(RenderingContext& ctx, RenderPassWorkContext& rgraphCtx
 		rgraphCtx.bindColorTexture(0, 4, m_r->getTemporalAA().getRt());
 
 		rgraphCtx.bindColorTexture(0, 5, m_r->getBloom().getRt());
-		cmdb->bindTexture(0, 6, m_lut->getGrTextureView(), TextureUsageBit::SAMPLED_FRAGMENT);
-		cmdb->bindTexture(0, 7, m_blueNoise->getGrTextureView(), TextureUsageBit::SAMPLED_FRAGMENT);
+		cmdb->bindTexture(0, 6, m_lut->getTextureView(), TextureUsageBit::SAMPLED_FRAGMENT);
+		cmdb->bindTexture(0, 7, m_blueNoise->getTextureView(), TextureUsageBit::SAMPLED_FRAGMENT);
 		rgraphCtx.bindColorTexture(0, 8, m_r->getMotionVectors().getMotionVectorsRt());
 		rgraphCtx.bindTexture(0, 9, m_r->getGBuffer().getDepthRt(),
 							  TextureSubresourceInfo(DepthStencilAspectBit::DEPTH));

+ 4 - 4
AnKi/Renderer/FinalComposite.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <AnKi/Renderer/RendererObject.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 
 namespace anki
 {
@@ -27,7 +27,7 @@ public:
 	void populateRenderGraph(RenderingContext& ctx);
 
 	/// Load the color grading texture.
-	Error loadColorGradingTexture(CString filename);
+	Error loadColorGradingTextureImage(CString filename);
 
 private:
 	static const U LUT_SIZE = 16;
@@ -40,8 +40,8 @@ private:
 	ShaderProgramResourcePtr m_defaultVisualizeRenderTargetProg;
 	ShaderProgramPtr m_defaultVisualizeRenderTargetGrProg;
 
-	TextureResourcePtr m_lut; ///< Color grading lookup texture.
-	TextureResourcePtr m_blueNoise;
+	ImageResourcePtr m_lut; ///< Color grading lookup texture.
+	ImageResourcePtr m_blueNoise;
 
 	class
 	{

+ 1 - 1
AnKi/Renderer/LensFlare.h

@@ -7,7 +7,7 @@
 
 #include <AnKi/Renderer/RendererObject.h>
 #include <AnKi/Gr.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 
 namespace anki
 {

+ 1 - 1
AnKi/Renderer/LightShading.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <AnKi/Renderer/RendererObject.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 
 namespace anki
 {

+ 3 - 3
AnKi/Renderer/ProbeReflections.h

@@ -8,7 +8,7 @@
 #include <AnKi/Renderer/Renderer.h>
 #include <AnKi/Renderer/RendererObject.h>
 #include <AnKi/Renderer/TraditionalDeferredShading.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 
 namespace anki
 {
@@ -38,7 +38,7 @@ public:
 
 	TextureViewPtr getIntegrationLut() const
 	{
-		return m_integrationLut->getGrTextureView();
+		return m_integrationLut->getTextureView();
 	}
 
 	SamplerPtr getIntegrationLutSampler() const
@@ -113,7 +113,7 @@ private:
 	HashMap<U64, U32> m_probeUuidToCacheEntryIdx;
 
 	// Other
-	TextureResourcePtr m_integrationLut;
+	ImageResourcePtr m_integrationLut;
 	SamplerPtr m_integrationLutSampler;
 
 	class

+ 2 - 2
AnKi/Renderer/RtShadows.cpp

@@ -38,7 +38,7 @@ Error RtShadows::initInternal(const ConfigSet& cfg)
 	m_useSvgf = cfg.getNumberU8("r_rtShadowsSvgf") != 0;
 	m_atrousPassCount = cfg.getNumberU8("r_rtShadowsSvgfAtrousPassCount");
 
-	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseRgb864x64.png", m_blueNoiseTex));
+	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseRgb864x64.png", m_blueNoiseImage));
 
 	// Ray gen program
 	{
@@ -508,7 +508,7 @@ void RtShadows::run(RenderPassWorkContext& rgraphCtx)
 	rgraphCtx.bindImage(0, 16, m_runCtx.m_currentHistoryLengthRt);
 	rgraphCtx.bindColorTexture(0, 17, m_runCtx.m_prevMomentsRt);
 	rgraphCtx.bindImage(0, 18, m_runCtx.m_currentMomentsRt);
-	cmdb->bindTexture(0, 19, m_blueNoiseTex->getGrTextureView(), TextureUsageBit::SAMPLED_TRACE_RAYS);
+	cmdb->bindTexture(0, 19, m_blueNoiseImage->getTextureView(), TextureUsageBit::SAMPLED_TRACE_RAYS);
 
 	cmdb->bindAllBindless(1);
 

+ 2 - 2
AnKi/Renderer/RtShadows.h

@@ -7,7 +7,7 @@
 
 #include <AnKi/Gr.h>
 #include <AnKi/Renderer/RendererObject.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Util/BitSet.h>
 #include <AnKi/Shaders/Include/RtShadows.h>
 
@@ -89,7 +89,7 @@ public:
 	ShaderProgramResourcePtr m_visualizeRenderTargetsProg;
 	/// @}
 
-	TextureResourcePtr m_blueNoiseTex;
+	ImageResourcePtr m_blueNoiseImage;
 
 	Array<ShadowLayer, MAX_RT_SHADOW_LAYERS> m_shadowLayers;
 

+ 1 - 1
AnKi/Renderer/ShadowMapping.h

@@ -7,7 +7,7 @@
 
 #include <AnKi/Renderer/RendererObject.h>
 #include <AnKi/Gr.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Renderer/TileAllocator.h>
 
 namespace anki

+ 1 - 1
AnKi/Renderer/ShadowmapsResolve.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <AnKi/Renderer/RendererObject.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Gr.h>
 
 namespace anki

+ 3 - 3
AnKi/Renderer/Ssao.cpp

@@ -21,7 +21,7 @@ Ssao::~Ssao()
 Error Ssao::initMain(const ConfigSet& config)
 {
 	// Noise
-	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseLdrRgb64x64.ankitex", m_main.m_noiseTex));
+	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseLdrRgb64x64.ankitex", m_main.m_noiseImage));
 
 	// Shader
 	if(m_useCompute)
@@ -36,7 +36,7 @@ Error Ssao::initMain(const ConfigSet& config)
 	ShaderProgramResourceVariantInitInfo variantInitInfo(m_main.m_prog);
 	variantInitInfo.addMutation("USE_NORMAL", (m_useNormal) ? 1u : 0u);
 	variantInitInfo.addMutation("SOFT_BLUR", (m_useSoftBlur) ? 1u : 0u);
-	variantInitInfo.addConstant("NOISE_MAP_SIZE", U32(m_main.m_noiseTex->getWidth()));
+	variantInitInfo.addConstant("NOISE_MAP_SIZE", U32(m_main.m_noiseImage->getWidth()));
 	variantInitInfo.addConstant("FB_SIZE", UVec2(m_width, m_height));
 	variantInitInfo.addConstant("RADIUS", 2.5f);
 	variantInitInfo.addConstant("BIAS", 0.0f);
@@ -136,7 +136,7 @@ void Ssao::runMain(const RenderingContext& ctx, RenderPassWorkContext& rgraphCtx
 	cmdb->bindSampler(0, 1, m_r->getSamplers().m_trilinearRepeat);
 
 	rgraphCtx.bindTexture(0, 2, m_r->getDepthDownscale().getHiZRt(), HIZ_HALF_DEPTH);
-	cmdb->bindTexture(0, 3, m_main.m_noiseTex->getGrTextureView(), TextureUsageBit::SAMPLED_FRAGMENT);
+	cmdb->bindTexture(0, 3, m_main.m_noiseImage->getTextureView(), TextureUsageBit::SAMPLED_FRAGMENT);
 
 	if(m_useNormal)
 	{

+ 2 - 2
AnKi/Renderer/Ssao.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <AnKi/Renderer/RendererObject.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Gr.h>
 
 namespace anki
@@ -50,7 +50,7 @@ private:
 	public:
 		ShaderProgramResourcePtr m_prog;
 		ShaderProgramPtr m_grProg;
-		TextureResourcePtr m_noiseTex;
+		ImageResourcePtr m_noiseImage;
 		Array<U32, 2> m_workgroupSize = {};
 	} m_main; ///< Main noisy pass.
 

+ 1 - 1
AnKi/Renderer/Ssgi.cpp

@@ -42,7 +42,7 @@ Error Ssgi::initInternal(const ConfigSet& cfg)
 	m_main.m_depthLod = min(cfg.getNumberU32("r_ssgiDepthLod"), m_r->getDepthDownscale().getMipmapCount() - 1);
 	m_main.m_firstStepPixels = 32;
 
-	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseRgb816x16.png", m_main.m_noiseTex));
+	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseRgb816x16.png", m_main.m_noiseImage));
 
 	// Init main
 	{

+ 2 - 2
AnKi/Renderer/Ssgi.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <AnKi/Renderer/RendererObject.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Gr.h>
 
 namespace anki
@@ -51,7 +51,7 @@ private:
 		ShaderProgramResourcePtr m_prog;
 		Array<ShaderProgramPtr, 4> m_grProg;
 		RenderTargetDescription m_rtDescr;
-		TextureResourcePtr m_noiseTex;
+		ImageResourcePtr m_noiseImage;
 		U32 m_maxSteps = 32;
 		U32 m_firstStepPixels = 16;
 		U32 m_depthLod = 0;

+ 2 - 2
AnKi/Renderer/Ssr.cpp

@@ -38,7 +38,7 @@ Error Ssr::initInternal(const ConfigSet& cfg)
 	m_depthLod = cfg.getNumberU32("r_ssrDepthLod");
 	m_firstStepPixels = 32;
 
-	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseRgb816x16.png", m_noiseTex));
+	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseRgb816x16.png", m_noiseImage));
 
 	// Create RTs
 	TextureInitInfo texinit = m_r->create2DRenderTargetInitInfo(
@@ -127,7 +127,7 @@ void Ssr::run(RenderPassWorkContext& rgraphCtx)
 	rgraphCtx.bindColorTexture(0, 6, m_r->getDownscaleBlur().getRt());
 
 	cmdb->bindSampler(0, 7, m_r->getSamplers().m_trilinearRepeat);
-	cmdb->bindTexture(0, 8, m_noiseTex->getGrTextureView(), TextureUsageBit::ALL_SAMPLED);
+	cmdb->bindTexture(0, 8, m_noiseImage->getTextureView(), TextureUsageBit::ALL_SAMPLED);
 
 	// Dispatch
 	dispatchPPCompute(cmdb, m_workgroupSize[0], m_workgroupSize[1], m_r->getWidth() / 2, m_r->getHeight());

+ 1 - 1
AnKi/Renderer/Ssr.h

@@ -40,7 +40,7 @@ private:
 	Array<ShaderProgramPtr, 2> m_grProg;
 
 	TexturePtr m_rt;
-	TextureResourcePtr m_noiseTex;
+	ImageResourcePtr m_noiseImage;
 
 	Array<U32, 2> m_workgroupSize = {};
 	U32 m_maxSteps = 32;

+ 3 - 3
AnKi/Renderer/VolumetricLightingAccumulation.cpp

@@ -7,7 +7,7 @@
 #include <AnKi/Renderer/ShadowMapping.h>
 #include <AnKi/Renderer/GlobalIllumination.h>
 #include <AnKi/Renderer/Renderer.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Core/ConfigSet.h>
 
 namespace anki
@@ -42,7 +42,7 @@ Error VolumetricLightingAccumulation::init(const ConfigSet& config)
 		return Error::USER_DATA;
 	}
 
-	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseRgb864x64.png", m_noiseTex));
+	ANKI_CHECK(getResourceManager().loadResource("EngineAssets/BlueNoiseRgb864x64.png", m_noiseImage));
 
 	// Shaders
 	ANKI_CHECK(getResourceManager().loadResource("Shaders/VolumetricLightingAccumulation.ankiprog", m_prog));
@@ -116,7 +116,7 @@ void VolumetricLightingAccumulation::run(RenderPassWorkContext& rgraphCtx)
 
 	rgraphCtx.bindImage(0, 2, m_runCtx.m_rts[1], TextureSubresourceInfo());
 
-	cmdb->bindTexture(0, 3, m_noiseTex->getGrTextureView(), TextureUsageBit::SAMPLED_COMPUTE);
+	cmdb->bindTexture(0, 3, m_noiseImage->getTextureView(), TextureUsageBit::SAMPLED_COMPUTE);
 
 	rgraphCtx.bindColorTexture(0, 4, m_runCtx.m_rts[0]);
 

+ 1 - 1
AnKi/Renderer/VolumetricLightingAccumulation.h

@@ -41,7 +41,7 @@ private:
 	ShaderProgramPtr m_grProg;
 
 	Array<TexturePtr, 2> m_rtTextures;
-	TextureResourcePtr m_noiseTex;
+	ImageResourcePtr m_noiseImage;
 
 	U32 m_finalZSplit = 0;
 

+ 2 - 2
AnKi/Resource.h

@@ -12,8 +12,8 @@
 #include <AnKi/Resource/MeshResource.h>
 #include <AnKi/Resource/CpuMeshResource.h>
 #include <AnKi/Resource/MaterialResource.h>
-#include <AnKi/Resource/TextureAtlasResource.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageAtlasResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Resource/GenericResource.h>
 #include <AnKi/Resource/SkeletonResource.h>
 #include <AnKi/Resource/DummyResource.h>

+ 1 - 1
AnKi/Resource/ConfigDefs.h

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-ANKI_CONFIG_OPTION(rsrc_maxTextureSize, 1024u * 1024u, 4u, MAX_U32)
+ANKI_CONFIG_OPTION(rsrc_maxImageSize, 1024u * 1024u, 4u, MAX_U32)
 ANKI_CONFIG_OPTION(rsrc_dumpShaderSources, 0, 0, 1)
 ANKI_CONFIG_OPTION(
 	rsrc_dataPaths, ".",

+ 0 - 1
AnKi/Resource/GenericResource.h

@@ -21,7 +21,6 @@ public:
 
 	~GenericResource();
 
-	/// Load a texture
 	ANKI_USE_RESULT Error load(const ResourceFilename& filename, Bool async);
 
 	const DynamicArray<U8>& getData() const

+ 22 - 22
AnKi/Resource/TextureAtlasResource.cpp → AnKi/Resource/ImageAtlasResource.cpp

@@ -3,25 +3,25 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <AnKi/Resource/TextureAtlasResource.h>
+#include <AnKi/Resource/ImageAtlasResource.h>
 #include <AnKi/Resource/ResourceManager.h>
 #include <AnKi/Util/Xml.h>
 
 namespace anki
 {
 
-TextureAtlasResource::TextureAtlasResource(ResourceManager* manager)
+ImageAtlasResource::ImageAtlasResource(ResourceManager* manager)
 	: ResourceObject(manager)
 {
 }
 
-TextureAtlasResource::~TextureAtlasResource()
+ImageAtlasResource::~ImageAtlasResource()
 {
 	m_subTexes.destroy(getAllocator());
 	m_subTexNames.destroy(getAllocator());
 }
 
-Error TextureAtlasResource::load(const ResourceFilename& filename, Bool async)
+Error ImageAtlasResource::load(const ResourceFilename& filename, Bool async)
 {
 	XmlDocument doc;
 	ANKI_CHECK(openFileParseXml(filename, doc));
@@ -29,28 +29,28 @@ Error TextureAtlasResource::load(const ResourceFilename& filename, Bool async)
 	XmlElement rootel, el;
 
 	//
-	// <textureAtlas>
+	// <imageAtlas>
 	//
-	ANKI_CHECK(doc.getChildElement("textureAtlas", rootel));
+	ANKI_CHECK(doc.getChildElement("imageAtlas", rootel));
 
 	//
-	// <texture>
+	// <image>
 	//
-	ANKI_CHECK(rootel.getChildElement("texture", el));
+	ANKI_CHECK(rootel.getChildElement("image", el));
 	CString texFname;
 	ANKI_CHECK(el.getText(texFname));
-	ANKI_CHECK(getManager().loadResource<TextureResource>(texFname, m_tex, async));
+	ANKI_CHECK(getManager().loadResource<ImageResource>(texFname, m_image, async));
 
-	m_size[0] = m_tex->getWidth();
-	m_size[1] = m_tex->getHeight();
+	m_size[0] = m_image->getWidth();
+	m_size[1] = m_image->getHeight();
 
 	//
-	// <subTextureMargin>
+	// <subImageMargin>
 	//
-	ANKI_CHECK(rootel.getChildElement("subTextureMargin", el));
+	ANKI_CHECK(rootel.getChildElement("subImageMargin", el));
 	I64 margin = 0;
 	ANKI_CHECK(el.getNumber(margin));
-	if(margin >= I(m_tex->getWidth()) || margin >= I(m_tex->getHeight()) || margin < 0)
+	if(margin >= I(m_image->getWidth()) || margin >= I(m_image->getHeight()) || margin < 0)
 	{
 		ANKI_RESOURCE_LOGE("Too big margin %d", I32(margin));
 		return Error::USER_DATA;
@@ -58,15 +58,15 @@ Error TextureAtlasResource::load(const ResourceFilename& filename, Bool async)
 	m_margin = U32(margin);
 
 	//
-	// <subTextures>
+	// <subImages>
 	//
 
 	// Get counts
 	U32 namesSize = 0;
 	U32 subTexesCount = 0;
 	XmlElement subTexesEl, subTexEl;
-	ANKI_CHECK(rootel.getChildElement("subTextures", subTexesEl));
-	ANKI_CHECK(subTexesEl.getChildElement("subTexture", subTexEl));
+	ANKI_CHECK(rootel.getChildElement("subImages", subTexesEl));
+	ANKI_CHECK(subTexesEl.getChildElement("subImage", subTexEl));
 	do
 	{
 		ANKI_CHECK(subTexEl.getChildElement("name", el));
@@ -82,7 +82,7 @@ Error TextureAtlasResource::load(const ResourceFilename& filename, Bool async)
 		namesSize += U32(name.getLength()) + 1;
 		++subTexesCount;
 
-		ANKI_CHECK(subTexEl.getNextSiblingElement("subTexture", subTexEl));
+		ANKI_CHECK(subTexEl.getNextSiblingElement("subImage", subTexEl));
 	} while(subTexEl);
 
 	// Allocate
@@ -92,7 +92,7 @@ Error TextureAtlasResource::load(const ResourceFilename& filename, Bool async)
 	// Iterate again and populate
 	subTexesCount = 0;
 	char* names = &m_subTexNames[0];
-	ANKI_CHECK(subTexesEl.getChildElement("subTexture", subTexEl));
+	ANKI_CHECK(subTexesEl.getChildElement("subImage", subTexEl));
 	do
 	{
 		ANKI_CHECK(subTexEl.getChildElement("name", el));
@@ -111,13 +111,13 @@ Error TextureAtlasResource::load(const ResourceFilename& filename, Bool async)
 		names += name.getLength() + 1;
 		++subTexesCount;
 
-		ANKI_CHECK(subTexEl.getNextSiblingElement("subTexture", subTexEl));
+		ANKI_CHECK(subTexEl.getNextSiblingElement("subImage", subTexEl));
 	} while(subTexEl);
 
 	return Error::NONE;
 }
 
-Error TextureAtlasResource::getSubTextureInfo(CString name, F32 uv[4]) const
+Error ImageAtlasResource::getSubImageInfo(CString name, F32 uv[4]) const
 {
 	for(const SubTex& st : m_subTexes)
 	{
@@ -131,7 +131,7 @@ Error TextureAtlasResource::getSubTextureInfo(CString name, F32 uv[4]) const
 		}
 	}
 
-	ANKI_RESOURCE_LOGE("Texture atlas %s doesn't have sub texture named: %s", &getFilename()[0], &name[0]);
+	ANKI_RESOURCE_LOGE("Image atlas %s doesn't have sub image named: %s", &getFilename()[0], &name[0]);
 	return Error::USER_DATA;
 }
 

+ 24 - 24
AnKi/Resource/TextureAtlasResource.h → AnKi/Resource/ImageAtlasResource.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <AnKi/Resource/ResourceObject.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Gr.h>
 
 namespace anki
@@ -15,41 +15,41 @@ namespace anki
 /// @addtogroup resource
 /// @{
 
-/// Texture atlas resource class.
+/// Image atlas resource class.
 ///
 /// XML format:
 /// @code
-/// <textureAtlas>
-/// 	<texture>path/to/tex.ankitex</texture>
-/// 	<subTextureMargin>N</subTextureMargin>
-/// 	<subTextures>
-/// 		<subTexture>
+/// <imageAtlas>
+/// 	<image>path/to/tex.ankitex</image>
+/// 	<subImageMargin>N</subImageMargin>
+/// 	<subImages>
+/// 		<subImage>
 /// 			<name>name</name>
 /// 			<uv>0.1 0.2 0.5 0.6</uv>
-/// 		</subTexture>
-/// 		<subTexture>...</subTexture>
+/// 		</subImage>
+/// 		<subImage>...</subImage>
 /// 		...
-/// 	</subTextures>
-/// </textureAtlas>
+/// 	</subImages>
+/// </imageAtlas>
 /// @endcode
-class TextureAtlasResource : public ResourceObject
+class ImageAtlasResource : public ResourceObject
 {
 public:
-	TextureAtlasResource(ResourceManager* manager);
+	ImageAtlasResource(ResourceManager* manager);
 
-	~TextureAtlasResource();
+	~ImageAtlasResource();
 
-	/// Load a texture atlas.
+	/// Load the atlas.
 	ANKI_USE_RESULT Error load(const ResourceFilename& filename, Bool async);
 
-	TexturePtr getGrTexture() const
+	TexturePtr getTexture() const
 	{
-		return m_tex->getGrTexture();
+		return m_image->getTexture();
 	}
 
-	TextureViewPtr getGrTextureView() const
+	TextureViewPtr getTextureView() const
 	{
-		return m_tex->getGrTextureView();
+		return m_image->getTextureView();
 	}
 
 	U32 getWidth() const
@@ -62,23 +62,23 @@ public:
 		return m_size[1];
 	}
 
-	U32 getSubTextureMargin() const
+	U32 getSubImageMargin() const
 	{
 		return m_margin;
 	}
 
-	/// Get the UV coordinates of a sub texture.
-	ANKI_USE_RESULT Error getSubTextureInfo(CString name, F32 uv[4]) const;
+	/// Get the UV coordinates of a sub image.
+	ANKI_USE_RESULT Error getSubImageInfo(CString name, F32 uv[4]) const;
 
 private:
 	class SubTex
 	{
 	public:
-		CString m_name; ///< Points to TextureAtlas::m_subTexNames.
+		CString m_name; ///< Points to ImageAtlas::m_subTexNames.
 		Array<F32, 4> m_uv;
 	};
 
-	TextureResourcePtr m_tex;
+	ImageResourcePtr m_image;
 	DynamicArray<char> m_subTexNames;
 	DynamicArray<SubTex> m_subTexes;
 	Array<U32, 2> m_size;

+ 1 - 1
AnKi/Resource/ImageBinary.h

@@ -49,7 +49,7 @@ enum class ImageBinaryDataCompression : U32
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(ImageBinaryDataCompression)
 
-/// The 1st things that appears in a texture binary..
+/// The 1st things that appears in a image binary.
 class ImageBinaryHeader
 {
 public:

+ 1 - 1
AnKi/Resource/ImageBinary.xml

@@ -42,7 +42,7 @@ ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(ImageBinaryDataCompression)
 ]]></prefix_code>
 
 	<classes>
-		<class name="ImageBinaryHeader" comment="The 1st things that appears in a texture binary.">
+		<class name="ImageBinaryHeader" comment="The 1st things that appears in a image binary">
 			<members>
 				<member name="m_magic" type="U8" array_size="8"/>
 				<member name="m_width" type="U32"/>

+ 22 - 22
AnKi/Resource/ImageLoader.cpp

@@ -224,7 +224,7 @@ Error ImageLoader::loadCompressedTga(FileInterface& fs, U32& width, U32& height,
 
 	if((width <= 0) || (height <= 0) || ((bpp != 24) && (bpp != 32)))
 	{
-		ANKI_RESOURCE_LOGE("Invalid texture information");
+		ANKI_RESOURCE_LOGE("Invalid image information");
 		return Error::USER_DATA;
 	}
 
@@ -331,12 +331,12 @@ Error ImageLoader::loadTga(FileInterface& fs, U32& width, U32& height, U32& bpp,
 	return Error::NONE;
 }
 
-Error ImageLoader::loadAnkiTexture(FileInterface& file, U32 maxTextureSize,
-								   ImageBinaryDataCompression& preferredCompression,
-								   DynamicArray<ImageLoaderSurface>& surfaces, DynamicArray<ImageLoaderVolume>& volumes,
-								   GenericMemoryPoolAllocator<U8>& alloc, U32& width, U32& height, U32& depth,
-								   U32& layerCount, U32& mipCount, ImageBinaryType& textureType,
-								   ImageBinaryColorFormat& colorFormat)
+Error ImageLoader::loadAnkiImage(FileInterface& file, U32 maxImageSize,
+								 ImageBinaryDataCompression& preferredCompression,
+								 DynamicArray<ImageLoaderSurface>& surfaces, DynamicArray<ImageLoaderVolume>& volumes,
+								 GenericMemoryPoolAllocator<U8>& alloc, U32& width, U32& height, U32& depth,
+								 U32& layerCount, U32& mipCount, ImageBinaryType& imageType,
+								 ImageBinaryColorFormat& colorFormat)
 {
 	//
 	// Read and check the header
@@ -365,7 +365,7 @@ Error ImageLoader::loadAnkiTexture(FileInterface& file, U32 maxTextureSize,
 
 	if(header.m_type < ImageBinaryType::_2D || header.m_type > ImageBinaryType::_2D_ARRAY)
 	{
-		ANKI_RESOURCE_LOGE("Incorrect header: texture type");
+		ANKI_RESOURCE_LOGE("Incorrect header: image type");
 		return Error::USER_DATA;
 	}
 
@@ -395,7 +395,7 @@ Error ImageLoader::loadAnkiTexture(FileInterface& file, U32 maxTextureSize,
 
 	// Set a few things
 	colorFormat = header.m_colorFormat;
-	textureType = header.m_type;
+	imageType = header.m_type;
 
 	U32 faceCount = 1;
 	switch(header.m_type)
@@ -473,7 +473,7 @@ Error ImageLoader::loadAnkiTexture(FileInterface& file, U32 maxTextureSize,
 						U32(calcSurfaceSize(mipWidth, mipHeight, preferredCompression, header.m_colorFormat));
 
 					// Check if this mipmap can be skipped because of size
-					if(max(mipWidth, mipHeight) <= maxTextureSize || mip == header.m_mipmapCount - 1)
+					if(max(mipWidth, mipHeight) <= maxImageSize || mip == header.m_mipmapCount - 1)
 					{
 						ImageLoaderSurface& surf = *surfaces.emplaceBack(alloc);
 						surf.m_width = mipWidth;
@@ -510,7 +510,7 @@ Error ImageLoader::loadAnkiTexture(FileInterface& file, U32 maxTextureSize,
 				U32(calcVolumeSize(mipWidth, mipHeight, mipDepth, preferredCompression, header.m_colorFormat));
 
 			// Check if this mipmap can be skipped because of size
-			if(max(max(mipWidth, mipHeight), mipDepth) <= maxTextureSize || mip == header.m_mipmapCount - 1)
+			if(max(max(mipWidth, mipHeight), mipDepth) <= maxImageSize || mip == header.m_mipmapCount - 1)
 			{
 				ImageLoaderVolume& vol = *volumes.emplaceBack(alloc);
 				vol.m_width = mipWidth;
@@ -570,12 +570,12 @@ Error ImageLoader::loadStb(FileInterface& fs, U32& width, U32& height, DynamicAr
 	return Error::NONE;
 }
 
-Error ImageLoader::load(ResourceFilePtr rfile, const CString& filename, U32 maxTextureSize)
+Error ImageLoader::load(ResourceFilePtr rfile, const CString& filename, U32 maxImageSize)
 {
 	RsrcFile file;
 	file.m_rfile = rfile;
 
-	const Error err = loadInternal(file, filename, maxTextureSize);
+	const Error err = loadInternal(file, filename, maxImageSize);
 	if(err)
 	{
 		ANKI_RESOURCE_LOGE("Failed to read image: %s", filename.cstr());
@@ -584,12 +584,12 @@ Error ImageLoader::load(ResourceFilePtr rfile, const CString& filename, U32 maxT
 	return err;
 }
 
-Error ImageLoader::load(const CString& filename, U32 maxTextureSize)
+Error ImageLoader::load(const CString& filename, U32 maxImageSize)
 {
 	SystemFile file;
 	ANKI_CHECK(file.m_file.open(filename, FileOpenFlag::READ | FileOpenFlag::BINARY));
 
-	const Error err = loadInternal(file, filename, maxTextureSize);
+	const Error err = loadInternal(file, filename, maxImageSize);
 	if(err)
 	{
 		ANKI_RESOURCE_LOGE("Failed to read image: %s", filename.cstr());
@@ -598,7 +598,7 @@ Error ImageLoader::load(const CString& filename, U32 maxTextureSize)
 	return err;
 }
 
-Error ImageLoader::loadInternal(FileInterface& file, const CString& filename, U32 maxTextureSize)
+Error ImageLoader::loadInternal(FileInterface& file, const CString& filename, U32 maxImageSize)
 {
 	// get the extension
 	StringAuto ext(m_alloc);
@@ -611,7 +611,7 @@ Error ImageLoader::loadInternal(FileInterface& file, const CString& filename, U3
 	}
 
 	// load from this extension
-	m_textureType = ImageBinaryType::_2D;
+	m_imageType = ImageBinaryType::_2D;
 	m_compression = ImageBinaryDataCompression::RAW;
 
 	if(ext == "tga")
@@ -648,8 +648,8 @@ Error ImageLoader::loadInternal(FileInterface& file, const CString& filename, U3
 		m_compression = ImageBinaryDataCompression::S3TC;
 #endif
 
-		ANKI_CHECK(loadAnkiTexture(file, maxTextureSize, m_compression, m_surfaces, m_volumes, m_alloc, m_width,
-								   m_height, m_depth, m_layerCount, m_mipmapCount, m_textureType, m_colorFormat));
+		ANKI_CHECK(loadAnkiImage(file, maxImageSize, m_compression, m_surfaces, m_volumes, m_alloc, m_width, m_height,
+								 m_depth, m_layerCount, m_mipmapCount, m_imageType, m_colorFormat));
 	}
 	else if(ext == "png" || ext == "jpg")
 	{
@@ -680,7 +680,7 @@ const ImageLoaderSurface& ImageLoader::getSurface(U32 level, U32 face, U32 layer
 
 	U32 idx = 0;
 
-	switch(m_textureType)
+	switch(m_imageType)
 	{
 	case ImageBinaryType::_2D:
 		idx = level;
@@ -690,7 +690,7 @@ const ImageLoaderSurface& ImageLoader::getSurface(U32 level, U32 face, U32 layer
 		idx = level * 6 + face;
 		break;
 	case ImageBinaryType::_3D:
-		ANKI_ASSERT(0 && "Can't use that for 3D textures");
+		ANKI_ASSERT(0 && "Can't use that for 3D images");
 		break;
 	case ImageBinaryType::_2D_ARRAY:
 		idx = level * m_layerCount + layer;
@@ -704,7 +704,7 @@ const ImageLoaderSurface& ImageLoader::getSurface(U32 level, U32 face, U32 layer
 
 const ImageLoaderVolume& ImageLoader::getVolume(U32 level) const
 {
-	ANKI_ASSERT(m_textureType == ImageBinaryType::_3D);
+	ANKI_ASSERT(m_imageType == ImageBinaryType::_3D);
 	return m_volumes[level];
 }
 

+ 16 - 16
AnKi/Resource/ImageLoader.h

@@ -77,20 +77,20 @@ public:
 
 	U32 getDepth() const
 	{
-		ANKI_ASSERT(m_textureType == ImageBinaryType::_3D);
+		ANKI_ASSERT(m_imageType == ImageBinaryType::_3D);
 		return m_depth;
 	}
 
 	U32 getLayerCount() const
 	{
-		ANKI_ASSERT(m_textureType == ImageBinaryType::_2D_ARRAY);
+		ANKI_ASSERT(m_imageType == ImageBinaryType::_2D_ARRAY);
 		return m_layerCount;
 	}
 
-	ImageBinaryType getTextureType() const
+	ImageBinaryType getImageType() const
 	{
-		ANKI_ASSERT(m_textureType != ImageBinaryType::NONE);
-		return m_textureType;
+		ANKI_ASSERT(m_imageType != ImageBinaryType::NONE);
+		return m_imageType;
 	}
 
 	const ImageLoaderSurface& getSurface(U32 level, U32 face, U32 layer) const;
@@ -98,10 +98,10 @@ public:
 	const ImageLoaderVolume& getVolume(U32 level) const;
 
 	/// Load a resource image file.
-	ANKI_USE_RESULT Error load(ResourceFilePtr file, const CString& filename, U32 maxTextureSize = MAX_U32);
+	ANKI_USE_RESULT Error load(ResourceFilePtr file, const CString& filename, U32 maxImageSize = MAX_U32);
 
 	/// Load a system image file.
-	ANKI_USE_RESULT Error load(const CString& filename, U32 maxTextureSize = MAX_U32);
+	ANKI_USE_RESULT Error load(const CString& filename, U32 maxImageSize = MAX_U32);
 
 private:
 	class FileInterface;
@@ -123,7 +123,7 @@ private:
 	U32 m_layerCount = 0;
 	ImageBinaryDataCompression m_compression = ImageBinaryDataCompression::NONE;
 	ImageBinaryColorFormat m_colorFormat = ImageBinaryColorFormat::NONE;
-	ImageBinaryType m_textureType = ImageBinaryType::NONE;
+	ImageBinaryType m_imageType = ImageBinaryType::NONE;
 
 	void destroy();
 
@@ -139,15 +139,15 @@ private:
 	static ANKI_USE_RESULT Error loadStb(FileInterface& fs, U32& width, U32& height, DynamicArray<U8>& data,
 										 GenericMemoryPoolAllocator<U8>& alloc);
 
-	static ANKI_USE_RESULT Error loadAnkiTexture(FileInterface& file, U32 maxTextureSize,
-												 ImageBinaryDataCompression& preferredCompression,
-												 DynamicArray<ImageLoaderSurface>& surfaces,
-												 DynamicArray<ImageLoaderVolume>& volumes,
-												 GenericMemoryPoolAllocator<U8>& alloc, U32& width, U32& height,
-												 U32& depth, U32& layerCount, U32& mipCount,
-												 ImageBinaryType& textureType, ImageBinaryColorFormat& colorFormat);
+	static ANKI_USE_RESULT Error loadAnkiImage(FileInterface& file, U32 maxImageSize,
+											   ImageBinaryDataCompression& preferredCompression,
+											   DynamicArray<ImageLoaderSurface>& surfaces,
+											   DynamicArray<ImageLoaderVolume>& volumes,
+											   GenericMemoryPoolAllocator<U8>& alloc, U32& width, U32& height,
+											   U32& depth, U32& layerCount, U32& mipCount, ImageBinaryType& imageType,
+											   ImageBinaryColorFormat& colorFormat);
 
-	ANKI_USE_RESULT Error loadInternal(FileInterface& file, const CString& filename, U32 maxTextureSize);
+	ANKI_USE_RESULT Error loadInternal(FileInterface& file, const CString& filename, U32 maxImageSize);
 };
 
 } // end namespace anki

+ 11 - 11
AnKi/Resource/TextureResource.cpp → AnKi/Resource/ImageResource.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Resource/ImageLoader.h>
 #include <AnKi/Resource/ResourceManager.h>
 #include <AnKi/Resource/AsyncLoader.h>
@@ -11,7 +11,7 @@
 namespace anki
 {
 
-class TextureResource::LoadingContext
+class ImageResource::LoadingContext
 {
 public:
 	ImageLoader m_loader;
@@ -28,11 +28,11 @@ public:
 	}
 };
 
-/// Texture upload async task.
-class TextureResource::TexUploadTask : public AsyncLoaderTask
+/// Image upload async task.
+class ImageResource::TexUploadTask : public AsyncLoaderTask
 {
 public:
-	TextureResource::LoadingContext m_ctx;
+	ImageResource::LoadingContext m_ctx;
 
 	TexUploadTask(GenericMemoryPoolAllocator<U8> alloc)
 		: m_ctx(alloc)
@@ -41,15 +41,15 @@ public:
 
 	Error operator()(AsyncLoaderTaskContext& ctx) final
 	{
-		return TextureResource::load(m_ctx);
+		return ImageResource::load(m_ctx);
 	}
 };
 
-TextureResource::~TextureResource()
+ImageResource::~ImageResource()
 {
 }
 
-Error TextureResource::load(const ResourceFilename& filename, Bool async)
+Error ImageResource::load(const ResourceFilename& filename, Bool async)
 {
 	TexUploadTask* task;
 	LoadingContext* ctx;
@@ -75,13 +75,13 @@ Error TextureResource::load(const ResourceFilename& filename, Bool async)
 	ResourceFilePtr file;
 	ANKI_CHECK(openFile(filename, file));
 
-	ANKI_CHECK(loader.load(file, filename, getManager().getMaxTextureSize()));
+	ANKI_CHECK(loader.load(file, filename, getManager().getMaxImageSize()));
 
 	// Various sizes
 	init.m_width = loader.getWidth();
 	init.m_height = loader.getHeight();
 
-	switch(loader.getTextureType())
+	switch(loader.getImageType())
 	{
 	case ImageBinaryType::_2D:
 		init.m_type = TextureType::_2D;
@@ -179,7 +179,7 @@ Error TextureResource::load(const ResourceFilename& filename, Bool async)
 	return Error::NONE;
 }
 
-Error TextureResource::load(LoadingContext& ctx)
+Error ImageResource::load(LoadingContext& ctx)
 {
 	const U32 copyCount = ctx.m_layerCount * ctx.m_faces * ctx.m_loader.getMipmapCount();
 

+ 9 - 9
AnKi/Resource/TextureResource.h → AnKi/Resource/ImageResource.h

@@ -14,31 +14,31 @@ namespace anki
 /// @addtogroup resource
 /// @{
 
-/// Texture resource class.
+/// Image resource class.
 ///
-/// It loads or creates an image and then loads it in the GPU. It supports compressed and uncompressed TGAs and AnKi's
-/// texture format.
-class TextureResource : public ResourceObject
+/// It loads or creates an image and then loads it in the GPU. It supports compressed and uncompressed TGAs, PNGs, JPEG
+/// and AnKi's image format.
+class ImageResource : public ResourceObject
 {
 public:
-	TextureResource(ResourceManager* manager)
+	ImageResource(ResourceManager* manager)
 		: ResourceObject(manager)
 	{
 	}
 
-	~TextureResource();
+	~ImageResource();
 
-	/// Load a texture
+	/// Load an image.
 	ANKI_USE_RESULT Error load(const ResourceFilename& filename, Bool async);
 
 	/// Get the texture.
-	const TexturePtr& getGrTexture() const
+	const TexturePtr& getTexture() const
 	{
 		return m_tex;
 	}
 
 	/// Get the texture view.
-	const TextureViewPtr& getGrTextureView() const
+	const TextureViewPtr& getTextureView() const
 	{
 		return m_texView;
 	}

+ 2 - 2
AnKi/Resource/InstantiationMacros.h

@@ -7,7 +7,7 @@
 
 ANKI_INSTANTIATE_RESOURCE(AnimationResource, AnimationResourcePtr)
 ANKI_INSTANSIATE_RESOURCE_DELIMITER()
-ANKI_INSTANTIATE_RESOURCE(TextureResource, TextureResourcePtr)
+ANKI_INSTANTIATE_RESOURCE(ImageResource, ImageResourcePtr)
 ANKI_INSTANSIATE_RESOURCE_DELIMITER()
 ANKI_INSTANTIATE_RESOURCE(MeshResource, MeshResourcePtr)
 ANKI_INSTANSIATE_RESOURCE_DELIMITER()
@@ -25,7 +25,7 @@ ANKI_INSTANTIATE_RESOURCE(DummyResource, DummyResourcePtr)
 ANKI_INSTANSIATE_RESOURCE_DELIMITER()
 ANKI_INSTANTIATE_RESOURCE(GenericResource, GenericResourcePtr)
 ANKI_INSTANSIATE_RESOURCE_DELIMITER()
-ANKI_INSTANTIATE_RESOURCE(TextureAtlasResource, TextureAtlasResourcePtr)
+ANKI_INSTANTIATE_RESOURCE(ImageAtlasResource, ImageAtlasResourcePtr)
 ANKI_INSTANSIATE_RESOURCE_DELIMITER()
 ANKI_INSTANTIATE_RESOURCE(ShaderProgramResource, ShaderProgramResourcePtr)
 ANKI_INSTANSIATE_RESOURCE_DELIMITER()

+ 4 - 4
AnKi/Resource/MaterialResource.cpp

@@ -5,7 +5,7 @@
 
 #include <AnKi/Resource/MaterialResource.h>
 #include <AnKi/Resource/ResourceManager.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Util/Xml.h>
 
 namespace anki
@@ -840,7 +840,7 @@ Error MaterialResource::parseInputs(XmlElement inputsEl, Bool async)
 			{
 				CString texfname;
 				ANKI_CHECK(inputEl.getAttributeText("value", texfname));
-				ANKI_CHECK(getManager().loadResource(texfname, foundVar->m_tex, async));
+				ANKI_CHECK(getManager().loadResource(texfname, foundVar->m_image, async));
 				break;
 			}
 
@@ -1235,9 +1235,9 @@ Error MaterialResource::parseRtMaterial(XmlElement rtMaterialEl)
 					ANKI_CHECK(inputEl.getAttributeText("value", fname));
 
 					const TextureChannelId textureIdx = GPU_MATERIAL_TEXTURES[i].m_textureSlot;
-					ANKI_CHECK(getManager().loadResource(fname, m_textureResources[textureIdx], false));
+					ANKI_CHECK(getManager().loadResource(fname, m_images[textureIdx], false));
 
-					m_textureViews[m_textureViewCount] = m_textureResources[textureIdx]->getGrTextureView();
+					m_textureViews[m_textureViewCount] = m_images[textureIdx]->getTextureView();
 
 					m_materialGpuDescriptor.m_bindlessTextureIndices[textureIdx] =
 						U16(m_textureViews[m_textureViewCount]->getOrCreateBindlessTextureIndex());

+ 7 - 7
AnKi/Resource/MaterialResource.h

@@ -8,7 +8,7 @@
 #include <AnKi/Resource/ResourceObject.h>
 #include <AnKi/Resource/RenderingKey.h>
 #include <AnKi/Resource/ShaderProgramResource.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Math.h>
 #include <AnKi/Util/Enum.h>
 #include <AnKi/Shaders/Include/ModelTypes.h>
@@ -88,7 +88,7 @@ public:
 		m_dataType = b.m_dataType;
 		m_builtin = b.m_builtin;
 		m_Mat4 = b.m_Mat4;
-		m_tex = std::move(b.m_tex);
+		m_image = std::move(b.m_image);
 		return *this;
 	}
 
@@ -171,12 +171,12 @@ protected:
 #undef ANKI_SVDT_MACRO
 	};
 
-	TextureResourcePtr m_tex;
+	ImageResourcePtr m_image;
 	/// @}
 
 	Bool valueSetByMaterial() const
 	{
-		return m_tex.isCreated() || m_numericValueIsSet;
+		return m_image.isCreated() || m_numericValueIsSet;
 	}
 };
 
@@ -198,11 +198,11 @@ protected:
 #undef ANKI_SPECIALIZE_GET_VALUE
 
 template<>
-inline const TextureResourcePtr& MaterialVariable::getValue() const
+inline const ImageResourcePtr& MaterialVariable::getValue() const
 {
 	ANKI_ASSERT(isTexture());
 	ANKI_ASSERT(m_builtin == BuiltinMaterialVariableId::NONE);
-	return m_tex;
+	return m_image;
 }
 
 /// Material variant.
@@ -439,7 +439,7 @@ private:
 
 	MaterialGpuDescriptor m_materialGpuDescriptor;
 
-	Array<TextureResourcePtr, U(TextureChannelId::COUNT)> m_textureResources; ///< Keep the resources alive.
+	Array<ImageResourcePtr, U(TextureChannelId::COUNT)> m_images; ///< Keep the resources alive.
 	Array<TextureViewPtr, U(TextureChannelId::COUNT)> m_textureViews; ///< Cache the GPU objects.
 	U8 m_textureViewCount = 0;
 

+ 3 - 3
AnKi/Resource/ResourceManager.cpp

@@ -17,9 +17,9 @@
 #include <AnKi/Resource/ScriptResource.h>
 #include <AnKi/Resource/DummyResource.h>
 #include <AnKi/Resource/ParticleEmitterResource.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Resource/GenericResource.h>
-#include <AnKi/Resource/TextureAtlasResource.h>
+#include <AnKi/Resource/ImageAtlasResource.h>
 #include <AnKi/Resource/ShaderProgramResource.h>
 #include <AnKi/Resource/SkeletonResource.h>
 
@@ -50,7 +50,7 @@ Error ResourceManager::init(ResourceManagerInitInfo& init)
 	m_cacheDir.create(m_alloc, init.m_cacheDir);
 
 	// Init some constants
-	m_maxTextureSize = init.m_config->getNumberU32("rsrc_maxTextureSize");
+	m_maxImageSize = init.m_config->getNumberU32("rsrc_maxImageSize");
 	m_dumpShaderSource = init.m_config->getBool("rsrc_dumpShaderSources");
 
 	// Init type resource managers

+ 3 - 3
AnKi/Resource/ResourceManager.h

@@ -129,9 +129,9 @@ public:
 
 	// Internals:
 
-	ANKI_INTERNAL U32 getMaxTextureSize() const
+	ANKI_INTERNAL U32 getMaxImageSize() const
 	{
-		return m_maxTextureSize;
+		return m_maxImageSize;
 	}
 
 	ANKI_INTERNAL Bool getDumpShaderSource() const
@@ -222,7 +222,7 @@ private:
 	ResourceAllocator<U8> m_alloc;
 	TempResourceAllocator<U8> m_tmpAlloc;
 	String m_cacheDir;
-	U32 m_maxTextureSize;
+	U32 m_maxImageSize;
 	AsyncLoader* m_asyncLoader = nullptr; ///< Async loading thread
 	ShaderProgramResourceSystem* m_shaderProgramSystem = nullptr;
 	U64 m_uuid = 0;

+ 6 - 6
AnKi/Scene/Components/DecalComponent.cpp

@@ -18,7 +18,7 @@ DecalComponent::DecalComponent(SceneNode* node)
 	, m_node(node)
 {
 	ANKI_ASSERT(node);
-	if(node->getSceneGraph().getResourceManager().loadResource("EngineAssets/GreenDecal.ankitex", m_debugTex))
+	if(node->getSceneGraph().getResourceManager().loadResource("EngineAssets/GreenDecal.ankitex", m_debugImage))
 	{
 		ANKI_SCENE_LOGF("Failed to load resources");
 	}
@@ -34,17 +34,17 @@ Error DecalComponent::setLayer(CString texAtlasFname, CString texAtlasSubtexName
 
 	ANKI_CHECK(m_node->getSceneGraph().getResourceManager().loadResource(texAtlasFname, l.m_atlas));
 
-	ANKI_CHECK(l.m_atlas->getSubTextureInfo(texAtlasSubtexName, &l.m_uv[0]));
+	ANKI_CHECK(l.m_atlas->getSubImageInfo(texAtlasSubtexName, &l.m_uv[0]));
 
 	// Add a border to the UVs to avoid complex shader logic
-	if(l.m_atlas->getSubTextureMargin() < ATLAS_SUB_TEXTURE_MARGIN)
+	if(l.m_atlas->getSubImageMargin() < ATLAS_SUB_IMAGE_MARGIN)
 	{
-		ANKI_SCENE_LOGE("Need texture atlas with margin at least %u", ATLAS_SUB_TEXTURE_MARGIN);
+		ANKI_SCENE_LOGE("Need image atlas with margin at least %u", ATLAS_SUB_IMAGE_MARGIN);
 		return Error::USER_DATA;
 	}
 
 	const Vec2 marginf =
-		F32(ATLAS_SUB_TEXTURE_MARGIN / 2) / Vec2(F32(l.m_atlas->getWidth()), F32(l.m_atlas->getHeight()));
+		F32(ATLAS_SUB_IMAGE_MARGIN / 2) / Vec2(F32(l.m_atlas->getWidth()), F32(l.m_atlas->getHeight()));
 	const Vec2 minUv = l.m_uv.xy() - marginf;
 	const Vec2 sizeUv = (l.m_uv.zw() - l.m_uv.xy()) + 2.0f * marginf;
 	l.m_uv = Vec4(minUv.x(), minUv.y(), minUv.x() + sizeUv.x(), minUv.y() + sizeUv.y());
@@ -109,7 +109,7 @@ void DecalComponent::draw(RenderQueueDrawContext& ctx) const
 	const Vec3 pos = m_obb.getCenter().xyz();
 	m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 		ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&pos, 1), Vec4(1.0f),
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugTex->getGrTextureView(),
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugImage->getTextureView(),
 		ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 	// Restore state

+ 8 - 8
AnKi/Scene/Components/DecalComponent.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <AnKi/Scene/Components/SceneComponent.h>
-#include <AnKi/Resource/TextureAtlasResource.h>
+#include <AnKi/Resource/ImageAtlasResource.h>
 #include <AnKi/Collision/Obb.h>
 #include <AnKi/Renderer/RenderQueue.h>
 
@@ -22,7 +22,7 @@ class DecalComponent : public SceneComponent
 	ANKI_SCENE_COMPONENT(DecalComponent)
 
 public:
-	static constexpr U32 ATLAS_SUB_TEXTURE_MARGIN = 16;
+	static constexpr U32 ATLAS_SUB_IMAGE_MARGIN = 16;
 
 	DecalComponent(SceneNode* node);
 
@@ -83,7 +83,7 @@ public:
 	void getDiffuseAtlasInfo(Vec4& uv, TexturePtr& tex, F32& blendFactor) const
 	{
 		uv = m_layers[LayerType::DIFFUSE].m_uv;
-		tex = m_layers[LayerType::DIFFUSE].m_atlas->getGrTexture();
+		tex = m_layers[LayerType::DIFFUSE].m_atlas->getTexture();
 		blendFactor = m_layers[LayerType::DIFFUSE].m_blendFactor;
 	}
 
@@ -92,7 +92,7 @@ public:
 		uv = m_layers[LayerType::SPECULAR_ROUGHNESS].m_uv;
 		if(m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas)
 		{
-			tex = m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas->getGrTexture();
+			tex = m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas->getTexture();
 		}
 		else
 		{
@@ -104,10 +104,10 @@ public:
 	void setupDecalQueueElement(DecalQueueElement& el)
 	{
 		el.m_diffuseAtlas = (m_layers[LayerType::DIFFUSE].m_atlas)
-								? m_layers[LayerType::DIFFUSE].m_atlas->getGrTextureView().get()
+								? m_layers[LayerType::DIFFUSE].m_atlas->getTextureView().get()
 								: nullptr;
 		el.m_specularRoughnessAtlas = (m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas)
-										  ? m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas->getGrTextureView().get()
+										  ? m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas->getTextureView().get()
 										  : nullptr;
 		el.m_diffuseAtlasUv = m_layers[LayerType::DIFFUSE].m_uv;
 		el.m_specularRoughnessAtlasUv = m_layers[LayerType::SPECULAR_ROUGHNESS].m_uv;
@@ -135,7 +135,7 @@ private:
 	class Layer
 	{
 	public:
-		TextureAtlasResourcePtr m_atlas;
+		ImageAtlasResourcePtr m_atlas;
 		Vec4 m_uv = Vec4(0.0f);
 		F32 m_blendFactor = 0.0f;
 	};
@@ -146,7 +146,7 @@ private:
 	Vec3 m_boxSize = Vec3(1.0f);
 	Transform m_trf = Transform::getIdentity();
 	Obb m_obb = Obb(Vec4(0.0f), Mat3x4::getIdentity(), Vec4(0.5f, 0.5f, 0.5f, 0.0f));
-	TextureResourcePtr m_debugTex;
+	ImageResourcePtr m_debugImage;
 	Bool m_markedForUpdate = true;
 
 	ANKI_USE_RESULT Error setLayer(CString texAtlasFname, CString texAtlasSubtexName, F32 blendFactor, LayerType type);

+ 3 - 3
AnKi/Scene/Components/GlobalIlluminationProbeComponent.cpp

@@ -6,7 +6,7 @@
 #include <AnKi/Scene/Components/GlobalIlluminationProbeComponent.h>
 #include <AnKi/Scene/SceneNode.h>
 #include <AnKi/Scene/SceneGraph.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Resource/ResourceManager.h>
 
 namespace anki
@@ -21,7 +21,7 @@ GlobalIlluminationProbeComponent::GlobalIlluminationProbeComponent(SceneNode* no
 	, m_markedForRendering(false)
 	, m_shapeDirty(true)
 {
-	if(node->getSceneGraph().getResourceManager().loadResource("EngineAssets/GiProbe.ankitex", m_debugTex))
+	if(node->getSceneGraph().getResourceManager().loadResource("EngineAssets/GiProbe.ankitex", m_debugImage))
 	{
 		ANKI_SCENE_LOGF("Failed to load resources");
 	}
@@ -59,7 +59,7 @@ void GlobalIlluminationProbeComponent::draw(RenderQueueDrawContext& ctx) const
 
 	m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 		ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&m_worldPosition, 1), Vec4(1.0f),
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugTex->getGrTextureView(),
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugImage->getTextureView(),
 		ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 	// Restore state

+ 1 - 1
AnKi/Scene/Components/GlobalIlluminationProbeComponent.h

@@ -124,7 +124,7 @@ private:
 	Bool m_markedForRendering : 1;
 	Bool m_shapeDirty : 1;
 
-	TextureResourcePtr m_debugTex;
+	ImageResourcePtr m_debugImage;
 
 	static void giProbeQueueElementFeedbackCallback(Bool fillRenderQueuesOnNextFrame, void* userData,
 													const Vec4& eyeWorldPosition)

+ 3 - 3
AnKi/Scene/Components/GpuParticleEmitterComponent.cpp

@@ -30,10 +30,10 @@ Error GpuParticleEmitterComponent::loadParticleEmitterResource(CString filename)
 	m_markedForUpdate = true;
 
 	// Create the debug drawer
-	if(!m_dbgTex.isCreated())
+	if(!m_dbgImage.isCreated())
 	{
 		ANKI_CHECK(m_node->getSceneGraph().getResourceManager().loadResource("EngineAssets/ParticleEmitter.ankitex",
-																			 m_dbgTex));
+																			 m_dbgImage));
 	}
 
 	// Load particle props
@@ -254,7 +254,7 @@ void GpuParticleEmitterComponent::draw(RenderQueueDrawContext& ctx) const
 
 		m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 			ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&m_worldPosition, 1), Vec4(1.0f),
-			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_dbgTex->getGrTextureView(),
+			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_dbgImage->getTextureView(),
 			ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 		// Restore state

+ 1 - 1
AnKi/Scene/Components/GpuParticleEmitterComponent.h

@@ -84,7 +84,7 @@ private:
 	Mat3x4 m_worldRotation = Mat3x4::getIdentity();
 	Aabb m_worldAabb = Aabb(Vec3(0.0f), Vec3(1.0f));
 
-	TextureResourcePtr m_dbgTex;
+	ImageResourcePtr m_dbgImage;
 
 	Bool m_markedForUpdate = true;
 

+ 3 - 3
AnKi/Scene/Components/LensFlareComponent.cpp

@@ -5,7 +5,7 @@
 
 #include <AnKi/Scene/Components/LensFlareComponent.h>
 #include <AnKi/Scene/SceneGraph.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Resource/ResourceManager.h>
 
 namespace anki
@@ -24,9 +24,9 @@ LensFlareComponent::~LensFlareComponent()
 {
 }
 
-Error LensFlareComponent::loadTextureResource(CString textureFilename)
+Error LensFlareComponent::loadImageResource(CString filename)
 {
-	return m_node->getSceneGraph().getResourceManager().loadResource(textureFilename, m_tex);
+	return m_node->getSceneGraph().getResourceManager().loadResource(filename, m_image);
 }
 
 } // end namespace anki

+ 8 - 8
AnKi/Scene/Components/LensFlareComponent.h

@@ -7,7 +7,7 @@
 
 #include <AnKi/Scene/SceneNode.h>
 #include <AnKi/Gr.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Renderer/RenderQueue.h>
 
 namespace anki
@@ -26,16 +26,16 @@ public:
 
 	~LensFlareComponent();
 
-	ANKI_USE_RESULT Error loadTextureResource(CString textureFilename);
+	ANKI_USE_RESULT Error loadImageResource(CString filename);
 
 	Bool isLoaded() const
 	{
-		return m_tex.isCreated();
+		return m_image.isCreated();
 	}
 
-	CString getTextureResourceFilename() const
+	CString getImageResourceFilename() const
 	{
-		return (m_tex) ? m_tex->getFilename() : CString();
+		return (m_image) ? m_image->getFilename() : CString();
 	}
 
 	void setWorldPosition(const Vec3& worldPosition)
@@ -80,7 +80,7 @@ public:
 
 	TexturePtr getTexture() const
 	{
-		return m_tex->getGrTexture();
+		return m_image->getTexture();
 	}
 
 	void setupLensFlareQueueElement(LensFlareQueueElement& el) const
@@ -88,7 +88,7 @@ public:
 		el.m_worldPosition = m_worldPosition;
 		el.m_firstFlareSize = m_firstFlareSize;
 		el.m_colorMultiplier = m_colorMul;
-		el.m_textureView = m_tex->getGrTextureView().get();
+		el.m_textureView = m_image->getTextureView().get();
 		el.m_userData = this;
 		el.m_drawCallback = debugDrawCallback;
 	}
@@ -97,7 +97,7 @@ private:
 	Vec4 m_colorMul = Vec4(1.0f); ///< Color multiplier.
 
 	SceneNode* m_node;
-	TextureResourcePtr m_tex; ///< Array of textures.
+	ImageResourcePtr m_image; ///< Array of textures.
 
 	Vec2 m_firstFlareSize = Vec2(1.0f);
 	Vec2 m_otherFlareSize = Vec2(1.0f);

+ 5 - 5
AnKi/Scene/Components/LightComponent.cpp

@@ -10,7 +10,7 @@
 #include <AnKi/Scene/Octree.h>
 #include <AnKi/Collision.h>
 #include <AnKi/Resource/ResourceManager.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Shaders/Include/ClusteredShadingTypes.h>
 
 namespace anki
@@ -29,8 +29,8 @@ LightComponent::LightComponent(SceneNode* node)
 	ANKI_ASSERT(m_uuid > 0);
 	m_point.m_radius = 1.0f;
 
-	if(node->getSceneGraph().getResourceManager().loadResource("EngineAssets/LightBulb.ankitex", m_pointDebugTex)
-	   || node->getSceneGraph().getResourceManager().loadResource("EngineAssets/SpotLight.ankitex", m_spotDebugTex))
+	if(node->getSceneGraph().getResourceManager().loadResource("EngineAssets/LightBulb.ankitex", m_pointDebugImage)
+	   || node->getSceneGraph().getResourceManager().loadResource("EngineAssets/SpotLight.ankitex", m_spotDebugImage))
 	{
 		ANKI_SCENE_LOGF("Failed to load resources");
 	}
@@ -238,10 +238,10 @@ void LightComponent::draw(RenderQueueDrawContext& ctx) const
 	Vec3 color = m_diffColor.xyz();
 	color /= max(max(color.x(), color.y()), color.z());
 
-	TextureResourcePtr texResource = (m_type == LightComponentType::POINT) ? m_pointDebugTex : m_spotDebugTex;
+	ImageResourcePtr imageResource = (m_type == LightComponentType::POINT) ? m_pointDebugImage : m_spotDebugImage;
 	m_node->getSceneGraph().getDebugDrawer().drawBillboardTexture(
 		ctx.m_projectionMatrix, ctx.m_viewMatrix, m_worldtransform.getOrigin().xyz(), color.xyz1(),
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), texResource->getGrTextureView(),
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), imageResource->getTextureView(),
 		ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 	// Restore state

+ 2 - 2
AnKi/Scene/Components/LightComponent.h

@@ -215,8 +215,8 @@ private:
 	Spot m_spot;
 	Dir m_dir;
 
-	TextureResourcePtr m_pointDebugTex;
-	TextureResourcePtr m_spotDebugTex;
+	ImageResourcePtr m_pointDebugImage;
+	ImageResourcePtr m_spotDebugImage;
 
 	LightComponentType m_type;
 

+ 3 - 3
AnKi/Scene/Components/ParticleEmitterComponent.cpp

@@ -212,10 +212,10 @@ ParticleEmitterComponent::~ParticleEmitterComponent()
 Error ParticleEmitterComponent::loadParticleEmitterResource(CString filename)
 {
 	// Create the debug drawer
-	if(!m_dbgTex.isCreated())
+	if(!m_dbgImage.isCreated())
 	{
 		ANKI_CHECK(m_node->getSceneGraph().getResourceManager().loadResource("EngineAssets/ParticleEmitter.ankitex",
-																			 m_dbgTex));
+																			 m_dbgImage));
 	}
 
 	// Load
@@ -450,7 +450,7 @@ void ParticleEmitterComponent::draw(RenderQueueDrawContext& ctx) const
 		const Vec3 pos = m_transform.getOrigin().xyz();
 		m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 			ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&pos, 1), Vec4(1.0f),
-			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_dbgTex->getGrTextureView(),
+			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_dbgImage->getTextureView(),
 			ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 		// Restore state

+ 1 - 1
AnKi/Scene/Components/ParticleEmitterComponent.h

@@ -90,7 +90,7 @@ private:
 	U32 m_vertBuffSize = 0;
 	void* m_verts = nullptr;
 
-	TextureResourcePtr m_dbgTex;
+	ImageResourcePtr m_dbgImage;
 
 	SimulationType m_simulationType = SimulationType::UNDEFINED;
 

+ 3 - 3
AnKi/Scene/Components/ReflectionProbeComponent.cpp

@@ -7,7 +7,7 @@
 #include <AnKi/Scene/SceneGraph.h>
 #include <AnKi/Scene/SceneNode.h>
 #include <AnKi/Resource/ResourceManager.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 
 namespace anki
 {
@@ -21,7 +21,7 @@ ReflectionProbeComponent::ReflectionProbeComponent(SceneNode* node)
 	, m_markedForRendering(false)
 	, m_markedForUpdate(true)
 {
-	if(node->getSceneGraph().getResourceManager().loadResource("EngineAssets/Mirror.ankitex", m_debugTex))
+	if(node->getSceneGraph().getResourceManager().loadResource("EngineAssets/Mirror.ankitex", m_debugImage))
 	{
 		ANKI_SCENE_LOGF("Failed to load resources");
 	}
@@ -61,7 +61,7 @@ void ReflectionProbeComponent::draw(RenderQueueDrawContext& ctx) const
 
 	m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 		ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&m_worldPos, 1), Vec4(1.0f),
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugTex->getGrTextureView(),
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugImage->getTextureView(),
 		ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 	// Restore state

+ 1 - 1
AnKi/Scene/Components/ReflectionProbeComponent.h

@@ -89,7 +89,7 @@ private:
 	Bool m_markedForRendering : 1;
 	Bool m_markedForUpdate : 1;
 
-	TextureResourcePtr m_debugTex;
+	ImageResourcePtr m_debugImage;
 
 	static void reflectionProbeQueueElementFeedbackCallback(Bool fillRenderQueuesOnNextFrame, void* userData)
 	{

+ 2 - 2
AnKi/Scene/Components/RenderComponent.cpp

@@ -5,7 +5,7 @@
 
 #include <AnKi/Scene/Components/RenderComponent.h>
 #include <AnKi/Scene/SceneNode.h>
-#include <AnKi/Resource/TextureResource.h>
+#include <AnKi/Resource/ImageResource.h>
 #include <AnKi/Resource/ResourceManager.h>
 #include <AnKi/Util/Logger.h>
 
@@ -243,7 +243,7 @@ void RenderComponent::allocateAndSetupUniforms(const MaterialResourcePtr& mtl, c
 		case ShaderVariableDataType::TEXTURE_CUBE:
 		{
 			ctx.m_commandBuffer->bindTexture(set, mvar.getOpaqueBinding(),
-											 mvar.getValue<TextureResourcePtr>()->getGrTextureView(),
+											 mvar.getValue<ImageResourcePtr>()->getTextureView(),
 											 TextureUsageBit::SAMPLED_FRAGMENT);
 			break;
 		}

+ 41 - 41
AnKi/Script/Scene.cpp

@@ -63,7 +63,7 @@ using WeakArraySceneNodePtr = WeakArray<SceneNode*>;
 using WeakArrayBodyComponentPtr = WeakArray<BodyComponent*>;
 
 LuaUserDataTypeInfo luaUserDataTypeInfoWeakArraySceneNodePtr = {
-	5358153435841694380, "WeakArraySceneNodePtr", LuaUserData::computeSizeForGarbageCollected<WeakArraySceneNodePtr>(),
+	-3650588055232078616, "WeakArraySceneNodePtr", LuaUserData::computeSizeForGarbageCollected<WeakArraySceneNodePtr>(),
 	nullptr, nullptr};
 
 template<>
@@ -189,7 +189,7 @@ static inline void wrapWeakArraySceneNodePtr(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoWeakArrayBodyComponentPtr = {
-	-3894045701657768727, "WeakArrayBodyComponentPtr",
+	-7580294434043141548, "WeakArrayBodyComponentPtr",
 	LuaUserData::computeSizeForGarbageCollected<WeakArrayBodyComponentPtr>(), nullptr, nullptr};
 
 template<>
@@ -314,7 +314,7 @@ static inline void wrapWeakArrayBodyComponentPtr(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoMoveComponent = {-4376980309725924869, "MoveComponent",
+LuaUserDataTypeInfo luaUserDataTypeInfoMoveComponent = {2039593201479231235, "MoveComponent",
 														LuaUserData::computeSizeForGarbageCollected<MoveComponent>(),
 														nullptr, nullptr};
 
@@ -736,7 +736,7 @@ static inline void wrapMoveComponent(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoLightComponent = {-5099986182800550501, "LightComponent",
+LuaUserDataTypeInfo luaUserDataTypeInfoLightComponent = {3179556689482799040, "LightComponent",
 														 LuaUserData::computeSizeForGarbageCollected<LightComponent>(),
 														 nullptr, nullptr};
 
@@ -1336,7 +1336,7 @@ static inline void wrapLightComponent(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoDecalComponent = {-5966391644502034892, "DecalComponent",
+LuaUserDataTypeInfo luaUserDataTypeInfoDecalComponent = {8271624451872560749, "DecalComponent",
 														 LuaUserData::computeSizeForGarbageCollected<DecalComponent>(),
 														 nullptr, nullptr};
 
@@ -1549,7 +1549,7 @@ static inline void wrapDecalComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoLensFlareComponent = {
-	-9132646314671520257, "LensFlareComponent", LuaUserData::computeSizeForGarbageCollected<LensFlareComponent>(),
+	-2476208308393286891, "LensFlareComponent", LuaUserData::computeSizeForGarbageCollected<LensFlareComponent>(),
 	nullptr, nullptr};
 
 template<>
@@ -1558,8 +1558,8 @@ const LuaUserDataTypeInfo& LuaUserData::getDataTypeInfoFor<LensFlareComponent>()
 	return luaUserDataTypeInfoLensFlareComponent;
 }
 
-/// Pre-wrap method LensFlareComponent::loadTextureResource.
-static inline int pwrapLensFlareComponentloadTextureResource(lua_State* l)
+/// Pre-wrap method LensFlareComponent::loadImageResource.
+static inline int pwrapLensFlareComponentloadImageResource(lua_State* l)
 {
 	LuaUserData* ud;
 	(void)ud;
@@ -1589,7 +1589,7 @@ static inline int pwrapLensFlareComponentloadTextureResource(lua_State* l)
 	}
 
 	// Call the method
-	Error ret = self->loadTextureResource(arg0);
+	Error ret = self->loadImageResource(arg0);
 
 	// Push return value
 	if(ANKI_UNLIKELY(ret))
@@ -1603,10 +1603,10 @@ static inline int pwrapLensFlareComponentloadTextureResource(lua_State* l)
 	return 1;
 }
 
-/// Wrap method LensFlareComponent::loadTextureResource.
-static int wrapLensFlareComponentloadTextureResource(lua_State* l)
+/// Wrap method LensFlareComponent::loadImageResource.
+static int wrapLensFlareComponentloadImageResource(lua_State* l)
 {
-	int res = pwrapLensFlareComponentloadTextureResource(l);
+	int res = pwrapLensFlareComponentloadImageResource(l);
 	if(res >= 0)
 	{
 		return res;
@@ -1724,13 +1724,13 @@ static int wrapLensFlareComponentsetColorMultiplier(lua_State* l)
 static inline void wrapLensFlareComponent(lua_State* l)
 {
 	LuaBinder::createClass(l, &luaUserDataTypeInfoLensFlareComponent);
-	LuaBinder::pushLuaCFuncMethod(l, "loadTextureResource", wrapLensFlareComponentloadTextureResource);
+	LuaBinder::pushLuaCFuncMethod(l, "loadImageResource", wrapLensFlareComponentloadImageResource);
 	LuaBinder::pushLuaCFuncMethod(l, "setFirstFlareSize", wrapLensFlareComponentsetFirstFlareSize);
 	LuaBinder::pushLuaCFuncMethod(l, "setColorMultiplier", wrapLensFlareComponentsetColorMultiplier);
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoBodyComponent = {8005666078544877940, "BodyComponent",
+LuaUserDataTypeInfo luaUserDataTypeInfoBodyComponent = {154937307550545885, "BodyComponent",
 														LuaUserData::computeSizeForGarbageCollected<BodyComponent>(),
 														nullptr, nullptr};
 
@@ -1912,7 +1912,7 @@ static inline void wrapBodyComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoTriggerComponent = {
-	8361758888032058938, "TriggerComponent", LuaUserData::computeSizeForGarbageCollected<TriggerComponent>(), nullptr,
+	-7657646622837619665, "TriggerComponent", LuaUserData::computeSizeForGarbageCollected<TriggerComponent>(), nullptr,
 	nullptr};
 
 template<>
@@ -2085,7 +2085,7 @@ static inline void wrapTriggerComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoFogDensityComponent = {
-	8822648658953771478, "FogDensityComponent", LuaUserData::computeSizeForGarbageCollected<FogDensityComponent>(),
+	-7940037986078247470, "FogDensityComponent", LuaUserData::computeSizeForGarbageCollected<FogDensityComponent>(),
 	nullptr, nullptr};
 
 template<>
@@ -2301,7 +2301,7 @@ static inline void wrapFogDensityComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoFrustumComponent = {
-	3504728886833991119, "FrustumComponent", LuaUserData::computeSizeForGarbageCollected<FrustumComponent>(), nullptr,
+	-6657872823488647939, "FrustumComponent", LuaUserData::computeSizeForGarbageCollected<FrustumComponent>(), nullptr,
 	nullptr};
 
 template<>
@@ -2487,7 +2487,7 @@ static inline void wrapFrustumComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoGlobalIlluminationProbeComponent = {
-	5809366118418768122, "GlobalIlluminationProbeComponent",
+	-3388167713742520037, "GlobalIlluminationProbeComponent",
 	LuaUserData::computeSizeForGarbageCollected<GlobalIlluminationProbeComponent>(), nullptr, nullptr};
 
 template<>
@@ -2749,7 +2749,7 @@ static inline void wrapGlobalIlluminationProbeComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoReflectionProbeComponent = {
-	7862167067639651124, "ReflectionProbeComponent",
+	858764927345348885, "ReflectionProbeComponent",
 	LuaUserData::computeSizeForGarbageCollected<ReflectionProbeComponent>(), nullptr, nullptr};
 
 template<>
@@ -2871,7 +2871,7 @@ static inline void wrapReflectionProbeComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoParticleEmitterComponent = {
-	2071718790476270277, "ParticleEmitterComponent",
+	-7137777058789215555, "ParticleEmitterComponent",
 	LuaUserData::computeSizeForGarbageCollected<ParticleEmitterComponent>(), nullptr, nullptr};
 
 template<>
@@ -2948,7 +2948,7 @@ static inline void wrapParticleEmitterComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoGpuParticleEmitterComponent = {
-	3523927141550120444, "GpuParticleEmitterComponent",
+	-6456898868368078429, "GpuParticleEmitterComponent",
 	LuaUserData::computeSizeForGarbageCollected<GpuParticleEmitterComponent>(), nullptr, nullptr};
 
 template<>
@@ -3024,7 +3024,7 @@ static inline void wrapGpuParticleEmitterComponent(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoModelComponent = {-1095755699367897219, "ModelComponent",
+LuaUserDataTypeInfo luaUserDataTypeInfoModelComponent = {2086284032202559852, "ModelComponent",
 														 LuaUserData::computeSizeForGarbageCollected<ModelComponent>(),
 														 nullptr, nullptr};
 
@@ -3100,7 +3100,7 @@ static inline void wrapModelComponent(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoSkinComponent = {-2716805544401529761, "SkinComponent",
+LuaUserDataTypeInfo luaUserDataTypeInfoSkinComponent = {-518282143757246989, "SkinComponent",
 														LuaUserData::computeSizeForGarbageCollected<SkinComponent>(),
 														nullptr, nullptr};
 
@@ -3177,7 +3177,7 @@ static inline void wrapSkinComponent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoSceneNode = {
-	8147782473759167183, "SceneNode", LuaUserData::computeSizeForGarbageCollected<SceneNode>(), nullptr, nullptr};
+	-6335486079252217101, "SceneNode", LuaUserData::computeSizeForGarbageCollected<SceneNode>(), nullptr, nullptr};
 
 template<>
 const LuaUserDataTypeInfo& LuaUserData::getDataTypeInfoFor<SceneNode>()
@@ -4121,7 +4121,7 @@ static inline void wrapSceneNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoModelNode = {
-	5081927013657519174, "ModelNode", LuaUserData::computeSizeForGarbageCollected<ModelNode>(), nullptr, nullptr};
+	-5697552120556254351, "ModelNode", LuaUserData::computeSizeForGarbageCollected<ModelNode>(), nullptr, nullptr};
 
 template<>
 const LuaUserDataTypeInfo& LuaUserData::getDataTypeInfoFor<ModelNode>()
@@ -4187,7 +4187,7 @@ static inline void wrapModelNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoPerspectiveCameraNode = {
-	4604155778368684360, "PerspectiveCameraNode", LuaUserData::computeSizeForGarbageCollected<PerspectiveCameraNode>(),
+	8713576863036804173, "PerspectiveCameraNode", LuaUserData::computeSizeForGarbageCollected<PerspectiveCameraNode>(),
 	nullptr, nullptr};
 
 template<>
@@ -4253,7 +4253,7 @@ static inline void wrapPerspectiveCameraNode(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoPointLightNode = {-8012714518862292321, "PointLightNode",
+LuaUserDataTypeInfo luaUserDataTypeInfoPointLightNode = {5334838824945854787, "PointLightNode",
 														 LuaUserData::computeSizeForGarbageCollected<PointLightNode>(),
 														 nullptr, nullptr};
 
@@ -4320,7 +4320,7 @@ static inline void wrapPointLightNode(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoSpotLightNode = {7500033143326152670, "SpotLightNode",
+LuaUserDataTypeInfo luaUserDataTypeInfoSpotLightNode = {1111579855048427605, "SpotLightNode",
 														LuaUserData::computeSizeForGarbageCollected<SpotLightNode>(),
 														nullptr, nullptr};
 
@@ -4388,7 +4388,7 @@ static inline void wrapSpotLightNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoDirectionalLightNode = {
-	7068345567705412778, "DirectionalLightNode", LuaUserData::computeSizeForGarbageCollected<DirectionalLightNode>(),
+	4106068051476431799, "DirectionalLightNode", LuaUserData::computeSizeForGarbageCollected<DirectionalLightNode>(),
 	nullptr, nullptr};
 
 template<>
@@ -4455,7 +4455,7 @@ static inline void wrapDirectionalLightNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoStaticCollisionNode = {
-	3374213409721501546, "StaticCollisionNode", LuaUserData::computeSizeForGarbageCollected<StaticCollisionNode>(),
+	-5852280982450969717, "StaticCollisionNode", LuaUserData::computeSizeForGarbageCollected<StaticCollisionNode>(),
 	nullptr, nullptr};
 
 template<>
@@ -4522,7 +4522,7 @@ static inline void wrapStaticCollisionNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoParticleEmitterNode = {
-	308162414292104717, "ParticleEmitterNode", LuaUserData::computeSizeForGarbageCollected<ParticleEmitterNode>(),
+	1168635594748949161, "ParticleEmitterNode", LuaUserData::computeSizeForGarbageCollected<ParticleEmitterNode>(),
 	nullptr, nullptr};
 
 template<>
@@ -4589,7 +4589,7 @@ static inline void wrapParticleEmitterNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoGpuParticleEmitterNode = {
-	-7046139684992474402, "GpuParticleEmitterNode",
+	6996471464684421249, "GpuParticleEmitterNode",
 	LuaUserData::computeSizeForGarbageCollected<GpuParticleEmitterNode>(), nullptr, nullptr};
 
 template<>
@@ -4656,7 +4656,7 @@ static inline void wrapGpuParticleEmitterNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoReflectionProbeNode = {
-	1734901777039035989, "ReflectionProbeNode", LuaUserData::computeSizeForGarbageCollected<ReflectionProbeNode>(),
+	-2536813390622684483, "ReflectionProbeNode", LuaUserData::computeSizeForGarbageCollected<ReflectionProbeNode>(),
 	nullptr, nullptr};
 
 template<>
@@ -4723,7 +4723,7 @@ static inline void wrapReflectionProbeNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoDecalNode = {
-	1107422719874792222, "DecalNode", LuaUserData::computeSizeForGarbageCollected<DecalNode>(), nullptr, nullptr};
+	-5087851201782551304, "DecalNode", LuaUserData::computeSizeForGarbageCollected<DecalNode>(), nullptr, nullptr};
 
 template<>
 const LuaUserDataTypeInfo& LuaUserData::getDataTypeInfoFor<DecalNode>()
@@ -4789,7 +4789,7 @@ static inline void wrapDecalNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoTriggerNode = {
-	-5828493001563535481, "TriggerNode", LuaUserData::computeSizeForGarbageCollected<TriggerNode>(), nullptr, nullptr};
+	-7647306451368817691, "TriggerNode", LuaUserData::computeSizeForGarbageCollected<TriggerNode>(), nullptr, nullptr};
 
 template<>
 const LuaUserDataTypeInfo& LuaUserData::getDataTypeInfoFor<TriggerNode>()
@@ -4854,7 +4854,7 @@ static inline void wrapTriggerNode(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoFogDensityNode = {-1570360321751976951, "FogDensityNode",
+LuaUserDataTypeInfo luaUserDataTypeInfoFogDensityNode = {7042619830118244604, "FogDensityNode",
 														 LuaUserData::computeSizeForGarbageCollected<FogDensityNode>(),
 														 nullptr, nullptr};
 
@@ -4922,7 +4922,7 @@ static inline void wrapFogDensityNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoGlobalIlluminationProbeNode = {
-	-4676947757449105581, "GlobalIlluminationProbeNode",
+	1885907464997344114, "GlobalIlluminationProbeNode",
 	LuaUserData::computeSizeForGarbageCollected<GlobalIlluminationProbeNode>(), nullptr, nullptr};
 
 template<>
@@ -4989,7 +4989,7 @@ static inline void wrapGlobalIlluminationProbeNode(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoSceneGraph = {
-	-728711174378303359, "SceneGraph", LuaUserData::computeSizeForGarbageCollected<SceneGraph>(), nullptr, nullptr};
+	23634668838832189, "SceneGraph", LuaUserData::computeSizeForGarbageCollected<SceneGraph>(), nullptr, nullptr};
 
 template<>
 const LuaUserDataTypeInfo& LuaUserData::getDataTypeInfoFor<SceneGraph>()
@@ -5813,7 +5813,7 @@ static inline void wrapSceneGraph(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoEvent = {-753540013505489432, "Event",
+LuaUserDataTypeInfo luaUserDataTypeInfoEvent = {5938471189504663942, "Event",
 												LuaUserData::computeSizeForGarbageCollected<Event>(), nullptr, nullptr};
 
 template<>
@@ -5882,7 +5882,7 @@ static inline void wrapEvent(lua_State* l)
 }
 
 LuaUserDataTypeInfo luaUserDataTypeInfoLightEvent = {
-	2510957790972778963, "LightEvent", LuaUserData::computeSizeForGarbageCollected<LightEvent>(), nullptr, nullptr};
+	2864282551783308985, "LightEvent", LuaUserData::computeSizeForGarbageCollected<LightEvent>(), nullptr, nullptr};
 
 template<>
 const LuaUserDataTypeInfo& LuaUserData::getDataTypeInfoFor<LightEvent>()
@@ -6006,7 +6006,7 @@ static inline void wrapLightEvent(lua_State* l)
 	lua_settop(l, 0);
 }
 
-LuaUserDataTypeInfo luaUserDataTypeInfoEventManager = {-4252054036229700576, "EventManager",
+LuaUserDataTypeInfo luaUserDataTypeInfoEventManager = {-9018362873037443259, "EventManager",
 													   LuaUserData::computeSizeForGarbageCollected<EventManager>(),
 													   nullptr, nullptr};
 

+ 1 - 1
AnKi/Script/Scene.xml

@@ -210,7 +210,7 @@ using WeakArrayBodyComponentPtr = WeakArray<BodyComponent*>;
 
 		<class name="LensFlareComponent">
 			<methods>
-				<method name="loadTextureResource">
+				<method name="loadImageResource">
 					<args>
 						<arg>CString</arg>
 					</args>

+ 1 - 1
Tools/CMakeLists.txt

@@ -1,3 +1,3 @@
 add_subdirectory(GltfImporter)
 add_subdirectory(Shader)
-add_subdirectory(Texture)
+add_subdirectory(Image)

+ 7 - 0
Tools/Image/CMakeLists.txt

@@ -0,0 +1,7 @@
+add_executable(ImageViewer ImageViewerMain.cpp)
+target_link_libraries(ImageViewer AnKi)
+installExecutable(ImageViewer)
+
+add_executable(ImageImporter ImageImporterMain.cpp)
+target_link_libraries(ImageImporter AnKi)
+installExecutable(ImageImporter)

+ 0 - 0
Tools/Texture/ConvertImage.py → Tools/Image/ConvertImage.py


+ 26 - 14
Tools/Texture/CreateAtlas.py → Tools/Image/CreateAtlas.py

@@ -9,6 +9,7 @@ import argparse
 from PIL import Image, ImageDraw
 from math import *
 import os
+import sys
 
 
 class SubImage:
@@ -63,11 +64,14 @@ def printi(msg):
 def parse_commandline():
     """ Parse the command line arguments """
 
-    parser = argparse.ArgumentParser(
-        description="This program creates a texture atlas", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    parser = argparse.ArgumentParser(description="This program creates a texture atlas",
+                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
 
-    parser.add_argument(
-        "-i", "--input", nargs="+", required=True, help="specify the image(s) to convert. Seperate with space")
+    parser.add_argument("-i",
+                        "--input",
+                        nargs="+",
+                        required=True,
+                        help="specify the image(s) to convert. Seperate with space")
 
     parser.add_argument("-o", "--output", default="atlas.png", help="specify output PNG image.")
 
@@ -191,8 +195,8 @@ def place_sub_images(ctx):
         sub_image = ctx.sub_images[unplaced_imgs[0]]
         unplaced_imgs.pop(0)
 
-        printi("Will try to place image \"%s\" of size %ux%d" % (sub_image.image_name, sub_image.width,
-                                                                 sub_image.height))
+        printi("Will try to place image \"%s\" of size %ux%d" %
+               (sub_image.image_name, sub_image.width, sub_image.height))
 
         # Find best frame
         best_frame = None
@@ -276,18 +280,26 @@ def create_atlas(ctx):
 def write_xml(ctx):
     """ Write the schema """
 
+    commandstring = ""
+    for arg in sys.argv[1:]:
+        if " " in arg:
+            commandstring += '"{}"  '.format(arg)
+    else:
+        commandstring += "{}  ".format(arg)
+
     fname = os.path.splitext(ctx.out_file)[0] + ".ankiatex"
     printi("Writing XML \"%s\"" % fname)
     f = open(fname, "w")
+    f.write("<!-- Generated by: %s -->" % commandstring)
     f.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n")
-    f.write("<textureAtlas>\n")
+    f.write("<imageAtlas>\n")
     out_filename = ctx.rpath + "/" + os.path.splitext(os.path.basename(ctx.out_file))[0] + ".ankitex"
-    f.write("\t<texture>%s</texture>\n" % out_filename)
-    f.write("\t<subTextureMargin>%u</subTextureMargin>\n" % ctx.margin)
-    f.write("\t<subTextures>\n")
+    f.write("\t<image>%s</image>\n" % out_filename)
+    f.write("\t<subImageMargin>%u</subImageMargin>\n" % ctx.margin)
+    f.write("\t<subImages>\n")
 
     for sub_image in ctx.sub_images:
-        f.write("\t\t<subTexture>\n")
+        f.write("\t\t<subImage>\n")
         f.write("\t\t\t<name>%s</name>\n" % os.path.basename(sub_image.image_name))
 
         # Now change coordinate system
@@ -297,10 +309,10 @@ def write_xml(ctx):
         bottom = top - (sub_image.height / ctx.atlas_height)
 
         f.write("\t\t\t<uv>%f %f %f %f</uv>\n" % (left, bottom, right, top))
-        f.write("\t\t</subTexture>\n")
+        f.write("\t\t</subImage>\n")
 
-    f.write("\t</subTextures>\n")
-    f.write("</textureAtlas>\n")
+    f.write("\t</subImages>\n")
+    f.write("</imageAtlas>\n")
 
 
 def main():

+ 0 - 0
Tools/Texture/TextureImporterMain.cpp → Tools/Image/ImageImporterMain.cpp


+ 9 - 9
Tools/Texture/TextureViewerMain.cpp → Tools/Image/ImageViewerMain.cpp

@@ -10,7 +10,7 @@ using namespace anki;
 class TextureViewerUiNode : public SceneNode
 {
 public:
-	TextureResourcePtr m_textureResource;
+	ImageResourcePtr m_imageResource;
 
 	TextureViewerUiNode(SceneGraph* scene, CString name)
 		: SceneNode(scene, name)
@@ -35,7 +35,7 @@ public:
 	{
 		if(!m_textureView.isCreated())
 		{
-			m_textureView = m_textureResource->getGrTextureView();
+			m_textureView = m_imageResource->getTextureView();
 		}
 
 		return Error::NONE;
@@ -53,7 +53,7 @@ private:
 
 	void draw(CanvasPtr& canvas)
 	{
-		const Texture& grTex = *m_textureResource->getGrTexture().get();
+		const Texture& grTex = *m_imageResource->getTexture().get();
 		const U32 colorComponentCount = getFormatInfo(grTex.getFormat()).m_componentCount;
 
 		ImGui::Begin("Console", nullptr,
@@ -134,7 +134,7 @@ private:
 			if(lastCrntMip != m_crntMip)
 			{
 				// Re-create the image view
-				TextureViewInitInfo viewInitInf(m_textureResource->getGrTexture());
+				TextureViewInitInfo viewInitInf(m_imageResource->getTexture());
 				viewInitInf.m_firstMipmap = m_crntMip;
 				viewInitInf.m_mipmapCount = 1;
 				m_textureView = getSceneGraph().getGrManager().newTextureView(viewInitInf);
@@ -231,20 +231,20 @@ public:
 		ANKI_CHECK(App::init(config, allocAligned, nullptr));
 
 		// Load the texture
-		TextureResourcePtr tex;
-		ANKI_CHECK(getResourceManager().loadResource(argv[1], tex, false));
+		ImageResourcePtr image;
+		ANKI_CHECK(getResourceManager().loadResource(argv[1], image, false));
 
 		// Change window name
 		StringAuto title(alloc);
-		title.sprintf("%s %llu x %llu Mips %u", argv[1], tex->getWidth(), tex->getHeight(),
-					  tex->getGrTexture()->getMipmapCount());
+		title.sprintf("%s %llu x %llu Mips %u", argv[1], image->getWidth(), image->getHeight(),
+					  image->getTexture()->getMipmapCount());
 		getWindow().setWindowTitle(title);
 
 		// Create the node
 		SceneGraph& scene = getSceneGraph();
 		TextureViewerUiNode* node;
 		ANKI_CHECK(scene.newSceneNode("TextureViewer", node));
-		node->m_textureResource = tex;
+		node->m_imageResource = image;
 
 		return Error::NONE;
 	}

+ 0 - 0
Tools/Texture/NoiseArray.py → Tools/Image/NoiseArray.py


+ 0 - 0
Tools/Texture/SegmentImage.py → Tools/Image/SegmentImage.py


+ 0 - 7
Tools/Texture/CMakeLists.txt

@@ -1,7 +0,0 @@
-add_executable(TextureViewer TextureViewerMain.cpp)
-target_link_libraries(TextureViewer AnKi)
-installExecutable(TextureViewer)
-
-add_executable(TextureImporter TextureImporterMain.cpp)
-target_link_libraries(TextureImporter AnKi)
-installExecutable(TextureImporter)