How to change texture UV coords on plane-mesh without help shaders (because i need to launch on retro-pc with voodoo 3dfx).
Also i need to enable flag GL_REPEAT (for unlimited scroll texture)
UV scale/rotate/tiling without shaders
Re: UV scale/rotate/tiling without shaders
There's 2 ways. First meshbuffers are made of vertices, usually S3DVertex: http://irrlicht.sourceforge.net/docu/st ... ertex.html
So it's possible to change the TCoords in there.
The other way is going over the material when drawing. SMaterial has a setTextureMatrix function which allows you set a matrix which modifies the texture drawing.
SMaterialLayer (in SMaterial you got a member TextureLayer which has one SMaterialLayer per texture) has TextureWrapU and TextureWrapV members. They can be set to irr::video::ETC_REPEAT, thought that is the default already so you'll only need it to set one of the other E_TEXTURE_CLAMP values: http://irrlicht.sourceforge.net/docu/na ... f84b39811f
So it's possible to change the TCoords in there.
The other way is going over the material when drawing. SMaterial has a setTextureMatrix function which allows you set a matrix which modifies the texture drawing.
SMaterialLayer (in SMaterial you got a member TextureLayer which has one SMaterialLayer per texture) has TextureWrapU and TextureWrapV members. They can be set to irr::video::ETC_REPEAT, thought that is the default already so you'll only need it to set one of the other E_TEXTURE_CLAMP values: http://irrlicht.sourceforge.net/docu/na ... f84b39811f
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: UV scale/rotate/tiling without shaders
I'm trying this
but no result
Code: Select all
float scroll;
...
//main loop
scroll += 1;
fognode->getMaterial(0).getTextureMatrix(0).setTranslation(vector3df(scroll,scroll,0));
...
Re: UV scale/rotate/tiling without shaders
Yeah, that's for 3d transformations. Look at all the matrix functions which have "texture" in the name, those will work with the kind of matrix you'll need here.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: UV scale/rotate/tiling without shaders
Strange...
Rotation and scaling is work (setRotation (), setScale() ) .
But scrolling does not work.
Hmm...
Rotation and scaling is work (setRotation (), setScale() ) .
But scrolling does not work.
Hmm...
Re: UV scale/rotate/tiling without shaders
Do you try to do that at the same time? If so - don't. I've not checked right now, but could be values do overwrite each other and you can only set them independent and then mulitply the matrixes to get a combined result.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: UV scale/rotate/tiling without shaders
Nope. I use this functions separatelyCuteAlien wrote:Do you try to do that at the same time?
by the way, engine version is 1.7.3 (for run under win98SE)
maybe there are bug in this version?
Re: UV scale/rotate/tiling without shaders
Code: Select all
fognode->getMaterial(0).getTextureMatrix(0).setTextureTranslate(scroll,scroll);
Re: UV scale/rotate/tiling without shaders
Ah good. And I thought Irrlicht 1.8 also still runs on Windows98, didn't know there are any troubles.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm