Daniel
Daniel

Reputation: 23359

OpenGL pixel manipulation for graphic

I want to simulate stroking a carpet, so you would have a graphic of a fury carpet and with your finger you can move around and stroke it. I need to shift pixels and create some fake distortion around where I am touching.

Anyone have any tips ?

Firstly I guess do I have enough to work with assuming I have 1 jpeg of the material. Not any skeleton or 3d file, just a flat image

Upvotes: 1

Views: 361

Answers (3)

fen
fen

Reputation: 10125

this can be also improved with 'fur rendering' I've some examples:

or new demo from NVidia:

http://www.youtube.com/watch?v=2Fp5N-pOxKA - around 35sec

Upvotes: 1

Morothar
Morothar

Reputation: 1123

As MrTJ says: Shaders is your key here.

Apart from your diffuse use a second texture as your "carpet" map that you modify. Maybe use the like a normal map, storing a directional vector per texel.

Use your "carpet" map in your shader and distort however you like to create your desired carpet effect.

Upvotes: 1

MrTJ
MrTJ

Reputation: 13202

Sounds like a typical task to be solved with OpenGL shaders.

Upvotes: 1

Related Questions