Jump to content
  • Advertisement
Sign in to follow this  
Rasmadrak

How does the texture matrix operate?

This topic is 4814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

if I have two quads, uv mapped as following...
 _____ _____ 
|     |     |
| /|\ |  |  |
|  |  |  |  |
|__|__|_\|/_|

The arrow points to up (on the texture map)


if I translate or rotate the texture matrix, will the quads be translated in the same way, or will they become "warped away" from each other? not sure how to explain what I mean, but if anyone understands what I'm saying... please respond! :) Peace!

Share this post


Link to post
Share on other sites
Advertisement
The texture matrix acts on the texture coordinates of geometry, not on the texture itself, or the geometry. I use the texture matrix to rotate and scale textures in my terrain engine. Gives me a lot more options with what I can do!

Also, I think the textures would become warped away from each other. Just an educated guess.

Share this post


Link to post
Share on other sites
So in other words, if I would draw a triangle fan around an island, and uv map so that all triangles' uv "point" inwards the island...

... would I be able to apply a foam/wave texture on the triangle fan and simply transform the texture matrix to get the waves moving towards the island? :)

just imagine, two or more layers of this - that would be a rather convincing shoreline, right? :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Rasmadrak
So in other words, if I would draw a triangle fan around an island, and uv map so that all triangles' uv "point" inwards the island...

... would I be able to apply a foam/wave texture on the triangle fan and simply transform the texture matrix to get the waves moving towards the island? :)

just imagine, two or more layers of this - that would be a rather convincing shoreline, right? :)


Yes you can but every triangle should point inwards the island. Then you have only to translate the matrix.
But the effect is credible only if you apply it near the island.

Share this post


Link to post
Share on other sites
Yes, that's what I meant! :)

so, a possible solution could be:

one big reflective water mass...

one or two layers of shoreline :)triangles, all pointing towards the island with their texture matrix modified along their "looking" direction...


Then glColor calls can be used to create fake fresnel effect on the shoreline too... :D


Got to try this when I get home from work! hehe.
Only problem will be to calculate the shoreline triangles, I guess!

Peace, ya´ll!






Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!