sampler2D sampTex0 : register(s0) = sampler_state { MinFilter = LINEAR; MagFilter = LINEAR; };
Why doesn't that work, when I use "register(s0)"???
I must use register(n) because otherwise it is impossible to set texture
units with textures. I need HLSL specific answer.
mip mapping with HLSL
Here is my code for loading terrain.
terrain = smgr->addTerrainSceneNode"../../media/terrain/heightmap.bmp");
float TERR_SIZE = 280;
terrain->setScale(core::vector3df(TERR_SIZE, 25.0f,TERR_SIZE));
driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
terrain->setPosition(vector3df(-TERR_SIZE*256/2,-700,-TERR_SIZE*256/2));
addTerrain(terrain,nWorld,terrain->getScale().X,terrain->getScale().Y,0,terrain->getPosition());
terrain->setMaterialType((video::E_MATERIAL_TYPE)matTerrain);
terrain->setMaterialFlag(video::EMF_LIGHTING, false);
terrain->setMaterialFlag(EMF_POINTCLOUD, false);
terrain->setMaterialFlag(video::EMF_BILINEAR_FILTER, true);
terrain->setMaterialTexture(0, driver->getTexture("../../media/TERRAIN/alphamap.bmp"));
terrain->setMaterialTexture(1, driver->getTexture("../../media/TERRAIN/s5.bmp"));
terrain->setMaterialTexture(2, driver->getTexture("../../media/TERRAIN/s18.bmp"));
terrain->setMaterialTexture(3, driver->getTexture("../../media/TERRAIN/s17.bmp"));
Result is here:
Why the hell filtering doesn't work as it should????
Don't forget I'm using register(s0)... stuff in shader because of 4 texture support.
terrain = smgr->addTerrainSceneNode"../../media/terrain/heightmap.bmp");
float TERR_SIZE = 280;
terrain->setScale(core::vector3df(TERR_SIZE, 25.0f,TERR_SIZE));
driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
terrain->setPosition(vector3df(-TERR_SIZE*256/2,-700,-TERR_SIZE*256/2));
addTerrain(terrain,nWorld,terrain->getScale().X,terrain->getScale().Y,0,terrain->getPosition());
terrain->setMaterialType((video::E_MATERIAL_TYPE)matTerrain);
terrain->setMaterialFlag(video::EMF_LIGHTING, false);
terrain->setMaterialFlag(EMF_POINTCLOUD, false);
terrain->setMaterialFlag(video::EMF_BILINEAR_FILTER, true);
terrain->setMaterialTexture(0, driver->getTexture("../../media/TERRAIN/alphamap.bmp"));
terrain->setMaterialTexture(1, driver->getTexture("../../media/TERRAIN/s5.bmp"));
terrain->setMaterialTexture(2, driver->getTexture("../../media/TERRAIN/s18.bmp"));
terrain->setMaterialTexture(3, driver->getTexture("../../media/TERRAIN/s17.bmp"));
Result is here:
Why the hell filtering doesn't work as it should????
Don't forget I'm using register(s0)... stuff in shader because of 4 texture support.
It looks to me that one or more textures are point filtered...
You know, this may be the same kind of thing that I'm seeing. I'm loading Doom3 MD5 models and applying four textures in a high-level custom shader: diffuse, gloss(specular), normal-map, height-map. I can see "pixellation" as though one or more of the texture stages are point filtered.
I'm going to go and see if I can track this down in the source. More later...
You know, this may be the same kind of thing that I'm seeing. I'm loading Doom3 MD5 models and applying four textures in a high-level custom shader: diffuse, gloss(specular), normal-map, height-map. I can see "pixellation" as though one or more of the texture stages are point filtered.
I'm going to go and see if I can track this down in the source. More later...
Is there a way to manually set the textures to point filtered?sio2 wrote:It looks to me that one or more textures are point filtered...
You know, this may be the same kind of thing that I'm seeing. I'm loading Doom3 MD5 models and applying four textures in a high-level custom shader: diffuse, gloss(specular), normal-map, height-map. I can see "pixellation" as though one or more of the texture stages are point filtered.
I'm going to go and see if I can track this down in the source. More later...
Individually, no. Currently, one setting is applied to all four texture units.BlindSide wrote:Is there a way to manually set the textures to point filtered?sio2 wrote:It looks to me that one or more textures are point filtered...
You know, this may be the same kind of thing that I'm seeing. I'm loading Doom3 MD5 models and applying four textures in a high-level custom shader: diffuse, gloss(specular), normal-map, height-map. I can see "pixellation" as though one or more of the texture stages are point filtered.
I'm going to go and see if I can track this down in the source. More later...