Archived

This topic is now archived and is closed to further replies.

Dark_Guy

Texture effects ? Are they reachable ?

Recommended Posts

I am coding a multimedia presentation, and i would like to add a lot of texture effects, just lek the ones used in final fantasy VIII and IX. But the problem is, i do not know how to manipulate a preloaded texture from within the CODE. For example i want to do fadeouts on certain textures, ore transforming one texture to another, or sliding it out line by line. Can anyone help me out ?

"Find the path, follow the Master... Follow the master, understand the master... Be the master !"

Share this post


Link to post
Share on other sites
although it is worthwhile to note that if you''re using D3DX to load your textures, the width, height and pixel format are somewhat unpredictable

so the code may get a little tricky :D

Qatal

Share this post


Link to post
Share on other sites
Qatal: Thus IDirect3DTexture*::GetLevelDesc to find out whatever you need.


aker_jus: Definately the way for old school 2D effects and 2D modfications to textures, and it sounds like what Dark Guy wants...however its usually far from the most optimal way to do it with modern 3D hardware.


Dark_Guy: Much better performance and a wider range of effects can be achieved with the following methods:

1) Map textures onto polygons with vertex colours in their vertices - adjust vertex colours to do things like fade out the texture. Add in the use of some interesting alpha blending modes such as SRCALPHA:ONE

2) Use texture transformation matrices to do scroll, rotate, zoom etc - you can do these transformations in full 3D space - a lot of the Final Fantasy type effects are simply things like cylinder, cone and sphere models with textures providing most of the effect - then the models AND texture coordinates can be transformed to get a lot of very nice effects.

3) Palettised textures - adjusting the palette on the fly is a very efficient way of achieving many old demo effects - colour cycling can go a long way if you use your imagination.



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
thanks. now my code will be readable to people other than me again :D. stupid of me not to have noticed that.......:@

paletted textures are definitely a cool thing, i agree :D

for the geometry supporting the texture, when it gets complex like cylinders and spheres, is it better to use an external model or generate them on the fly? (i know the distinction is a little blurred with things like vertex buffers and display lists, but yeah)

?

definitely reachable :D

Share this post


Link to post
Share on other sites
quote:
for the geometry supporting the texture, when it gets complex like cylinders and spheres, is it better to use an external model or generate them on the fly? (i know the distinction is a little blurred with things like vertex buffers and display lists, but yeah)


If the all the vertex motion required for an effect can be achieved with transformation matrices and/or by changing vertex shader parameters, I''d be inclined to pre-model the shape since it''s static, premodelling also allows "interesting" shapes.

Though that attitude probably reflects what happens in a commercial game setting (at the company I work for at least) - most of the "big" effects are made by the artists with any stuff they can''t do filled in by the programmer (e.g. they''ll come along to someone like me and say "I want this to look like neon inside glass, can you add a shader for that").
They can knock up the polygons, textures, animation, use a predefined shader etc in Max far quicker than most programmers would (while the programmers are still busy requesting algrithms for generating geodesic spheres on here )
Of course that approach depends how well the tools map to the engine and how well trained the artists are. There are of course times when the method the artist will use will be inefficient so a programmer takes over with code.




--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites