Browse Source

Set bilinear filter on the render texture so it looks better up close.

Lasse Öörni 12 years ago
parent
commit
dbdafefaae
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/Samples/10_RenderToTexture/RenderToTexture.cpp

+ 2 - 1
Source/Samples/10_RenderToTexture/RenderToTexture.cpp

@@ -179,9 +179,10 @@ void RenderToTexture::CreateScene()
             StaticModel* screenObject = screenNode->CreateComponent<StaticModel>();
             StaticModel* screenObject = screenNode->CreateComponent<StaticModel>();
             screenObject->SetModel(cache->GetResource<Model>("Models/Plane.mdl"));
             screenObject->SetModel(cache->GetResource<Model>("Models/Plane.mdl"));
             
             
-            // Create a renderable texture (1024x768, RGB format) and a material for it
+            // Create a renderable texture (1024x768, RGB format), enable bilinear filtering on it
             SharedPtr<Texture2D> renderTexture(new Texture2D(context_));
             SharedPtr<Texture2D> renderTexture(new Texture2D(context_));
             renderTexture->SetSize(1024, 768, Graphics::GetRGBFormat(), TEXTURE_RENDERTARGET);
             renderTexture->SetSize(1024, 768, Graphics::GetRGBFormat(), TEXTURE_RENDERTARGET);
+            renderTexture->SetFilterMode(FILTER_BILINEAR);
             
             
             // Create a new material from scratch, use the diffuse unlit technique, assign the render texture
             // Create a new material from scratch, use the diffuse unlit technique, assign the render texture
             // as its diffuse texture, then assign the material to the screen plane object
             // as its diffuse texture, then assign the material to the screen plane object