Volumes Of Fun http://www.volumesoffun.com/phpBB3/ |
|
Texture atlases, bleeding, mipmaps & filtering http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=152 |
Page 3 of 3 |
Author: | David Williams [ Mon Dec 31, 2012 10:16 am ] |
Post subject: | Re: Texture atlases, bleeding, mipmaps & filtering |
Unfortunatly your image is very small, but if I understand correctly you are saying that each of the tiles is not just a solid colour but instead has a number drawn on it, and yet you are not seeing these numbers after the texture mapping is performed? Maybe you have a larger image to show? One thing I notice is your use of mworldPos. This is a global variable and I would usually expect these to be set by the C++ program and read by the shaders. However, you are writing to it directly from the shader program, and I'm not sure if this is allowed or exactly what the implications are. I think I would expect you to pass the world position as another member of VS_OUTPUT: Code: struct VS_OUTPUT { float4 Position : POSITION; // vertex position float4 Diffuse : COLOR0; // vertex diffuse color float4 textureAtlasOff : TEXCOORD0; // tex coords float4 WorldSpacePosition : TEXCOORD1; // The world space position }; I'm not sure if this is actually your problem through. You migth also consider simplyfying the code so that you only have a single texture being applied (so you don't have to mess around with offsets) and get that working first. It might make it easier to see what the problem is. |
Author: | zprg [ Mon Dec 31, 2012 1:08 pm ] |
Post subject: | Re: Texture atlases, bleeding, mipmaps & filtering |
yes i first tested with one texture and it worked, but with one texture it anyway works for me in irrlicht without a shader, i wrote to the forum in July (http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=185&start=10 ). ok youre right the failure was that im always using the quick and dirty way ![]() changed to your suggestion with the coordinates in TEXCOORD1 and it works ! Thank you very much Sir David! (bigger pic now): ![]() the material is tunneled through color red in gnurfos irrlichtinterfacefunction, see link to other thread above. Code: mb->getVertexBuffer()[i].Color = irr::video::SColor(0,vertices[i].getMaterial(),0,0); for all interested - how in irrlicht shader are called read irrlicht example: http://irrlicht.sourceforge.net/docu/example010.html thanks again and have a nice sylvester |
Page 3 of 3 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |