Archived

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

Beavt8r

Matrix-style shader???

Recommended Posts

Beavt8r    123
I was just wondering if anybody here knew of a vertex/pixel shader (high-level or otherwise) that simulated the effect as seen in The Matrix or knows how to make one simulate it? I would absolutely love to have it! Also, I would say there''s a few of you that would, too If anybody can, let me know! Thanks!!!! It is coming...8 years in the making and It is finally coming... -Beavt8r

Share this post


Link to post
Share on other sites
Impossible    134
Uh... there were a lot of different effects in the matrix, which one are you talking about? The matrix style text would just be a texture trick and wouldn''t require pixel or vertex shaders. Bullet time is a gameplay\movement\animation trick and also doesn''t require pixel or vertex shaders.

Share this post


Link to post
Share on other sites
Beavt8r    123
Sorry about that. I meant the falling code effect. I wanted it with the leading character "shining". I thought it would be awesome to have it in a game. Texture effect, you say? Hmm....how exactly do you mean? Scrolling, procedural, maybe..?

[edited by - Beavt8r on January 29, 2003 10:41:18 PM]

Share this post


Link to post
Share on other sites
Impossible    134
I think there is a Matrix text screen saver demo (with source) somewhere out there. For the scrolling text you can use the texture matrix (no pun intended) and just translate the texture coordinates downward. You may have to just draw each character as an individual polygon, but even with tons of text that''s not a big deal. For the glowing character you may want to do some additive alpha blending or something of that nature. Neither pixel or vertex shaders are necessary for the effect, just good textures that look like the characters in the matrix.

Share this post


Link to post
Share on other sites
Beavt8r    123
I see. Most of my, um, "research" has been with shaders, so texture effects don't usually pop out to me. That sounds good, though. What about an alpha test? What I'm going for is something that you can really tell 3D like curves. Like this:


You can tell most details by the brightness or something. How would I do this? Would it just be as simple as normal lighting on the texture? Or would it have something to do with density? Like I said, all that comes to mind is something with shaders...yeah, yeah...I know. Your help is really appreciated!

[EDIT]Or would the distance take care of the size....[/EDIT]

[edited by - Beavt8r on January 30, 2003 1:00:04 AM]

Share this post


Link to post
Share on other sites
Impossible    134
Hmmmm... I see you want to do the "World as code" effect, and not just a simple console with scrolling text. A acsii 3D renderer would do the trick, but I''ve never seen this done in hardware. For this effect pixel and vertex shaders would be useful (I guess you were right.)

One way I''m thinking you could implement it is to render the scene (normally) to a texture at the same resolution as your text grid and convert it to luminance values. Then render a grid of random ascii characters or backwards katana or whatever the matrix code is written in, then use those luminance values from your original texture to set the brightness of the character. Your grid would update every frame, and you can preset the leading character to have full brightness.

I just completely pulled that technique out of the blue, it''s not documented anywhere and it may not work very well. There may also be much better (more optimized) ways to do this in hardware, but this should work.

Share this post


Link to post
Share on other sites
coelurus    259
What if the characters can "wrap around" the objects, as in the image? Using a pre-rendered grid will not work very good for 3D I guess. Also, you can''t just plot out random characters, the Matrix text doesn''t work that way.

Couldn''t just the brightness be normal lighting and perhaps with a detailed normal map? The textures could be like 4 different software-updated Matrix-textures used in different places and mirrored in some. I don''t know how to handle the text so that it falls down all the time, perhaps with tex-coord generation?
When I think of it, in OpenGL, you could use EYE_LINEAR to make the textures stay facing the viewer at all times. Letting the textures "fall down" might not be very hard after all. :D

This is really interesting, perhaps I''ll try this some day I made a lil'' falling-text demo in Matrix-style, I guess I could just copy that code...

Share this post


Link to post
Share on other sites
Beavt8r    123
Impossible...sounds good. If I can go and figure out exactly the characters in the Matrix code, I can just make it pull a random char out of the matrixChar array. That seems like it would work. Correct me if I'm wrong. Your technique sounds very good. Coelurus, I see what you mean. I think that if I (or somebody else) can get the shader set up right, I think that it would handle the tex coords and as Impossible said, the normal lighting would take care of the character brightness. Now the question is, how exactly to do this? I think we have it pretty well outlined, now on to the implementation...help, anyone?

It is coming...8 years in the making and It is finally coming...

-Beavt8r

[edited by - Beavt8r on January 30, 2003 1:10:32 PM]

Share this post


Link to post
Share on other sites
Impossible    134
quote:
Original post by coelurus
What if the characters can "wrap around" the objects, as in the image? Using a pre-rendered grid will not work very good for 3D I guess. Also, you can''t just plot out random characters, the Matrix text doesn''t work that way.


Hmmmm... it looks like a uniform gride to me. I think the reason why it looks curved is because of the brightness adjustment and all the text is screen aligned. If it is curved on the objects, you could just apply text textures directly to the characters. The random text thing wasn''t serious, I just wasn''t so sure about how the matrix text was laid out. When I said "random ASCII characters or backward katana or whatever the matrix uses" I meant moving text that looks like the matrix code in the consoles, just like your demo.


Share this post


Link to post
Share on other sites
Beavt8r    123
I agree. I think that the grid and lighting will do fine. Because the picture looks like all text is vertical (screen). What if I just rendered (every frame) the falling text and glowing leading character to a texture and just textured everything so that it''s aligned vertically and just had normal lighting?

It is coming...8 years in the making and It is finally coming...

-Beavt8r

Share this post


Link to post
Share on other sites
Beavt8r    123
If I used textures, how would I get them aligned vertically on all curves, etc...? In the picture, all the code is vertical, and I want it as close as I can get it to the real thing.

It is coming...8 years in the making and It is finally coming...

-Beavt8r

Share this post


Link to post
Share on other sites
greeneggs    130
automatic texture-coordinate generation? also i think it is more than just texture + lighting. it looks like there is some attempt to emphasize important lines, like contours

[edited by - greeneggs on January 30, 2003 11:17:13 PM]

Share this post


Link to post
Share on other sites
Beavt8r    123
Like edge detection? Not just on the side of an object, but on any edge? Hmmm.....

It is coming...8 years in the making and It is finally coming...

-Beavt8r

Share this post


Link to post
Share on other sites
easlern    134
You might be able to get that effect using a tiled texture of green characters, one that can be put next to itself on any side and not show a break in the image. Then render your regular model uncolored, with texturing enabled using "modulate" (not sure of the constant.) That''ll show dark where the characters aren''t, but still allow the image to bleed through the green characters. Use EYE_LINEAR and after each frame, set your matrix mode to GL_TEXTURE and translate downward a bit. Set your texture wrap mode to GL_REPEAT so the texture just starts over at the top when it starts wrapping around.
To make random characters glow, I would render another similar texture pass with a more sparse pattern at a faster speed (I think that''s how it looks in the movie?) using GL_INTENSITY or GL_LUMINANCE.
Now I''m rambling. Anyway, good question, and good luck on it.

Share this post


Link to post
Share on other sites
Pseudo    100
you could try rendering the scene, but only into the alpha channel, and then render the text using alpha blending so that you get the shading... sound pretty strait forward, and might give a similar appearance.

Share this post


Link to post
Share on other sites
Extrarius    1412
A problem with a lot of the solutions mentioned is that you wouldn''t get the cool ''dripping'' of the characters where they have one leading character and a trail of characters that fades to black only to be ''lit up'' again when the next leading character comes down. I would suggest you draw the characters to a full-screen texture each frame and use that in conjunctions with the other solution so you don''t leave out that important effect =-)

Share this post


Link to post
Share on other sites
Beavt8r    123
What if I rendered the scene colorless with normal lighting and generated the matrix texture and sort of shine a light through it, like this from Nvidia (except have the light further back or something):


In the other picture of the Matrix, the far away characters seem a little bigger. Would something like this work? With alpha-blending, maybe?

It is coming...8 years in the making and It is finally coming...

-Beavt8r


[edited by - Beavt8r on January 31, 2003 12:54:53 PM]

Share this post


Link to post
Share on other sites
jonbell    100
I''m pretty sure that with a little tinkering you could just skin the model using a single animated texture to get the effect. If you use a big texture (512x512 ish) you would avoid the sretch effect.

Share this post


Link to post
Share on other sites
Beavt8r    123
Well, my models won''t be too complex, due to some of the effects I''m using, so the animated texture sounds good...now, on to the texture...suggestions?

It is coming...8 years in the making and It is finally coming...

-Beavt8r

Share this post


Link to post
Share on other sites
_DarkWIng_    602
Something like this

http://www2.arnes.si/~ssdmtera/Download/TheMatrix.rar

Requires multitexturing & register combiners.. so.. GF users only. I was thrown together in 1/2 hour so please excuse some bugs... and I used simple torus-knot for object but you''ll get the point....

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
Beavt8r    123
Looks good,_DarkWIng_. That's kind of the effect I want, with all characters vertical. The glowing leading character I would say is easy to add, but how hard would separation of the the objects from the rest of the texture be? Like in the picture of Neo I posted earlier, how you can really see the difference in the background and the object (or in this case, Neo). Would it be just a lower lighting value on the matrix texture? That way the matrix texture would appear almost black when it's not on a model.

It is coming...8 years in the making and It is finally coming...

-Beavt8r


[edited by - Beavt8r on January 31, 2003 1:39:19 PM]

Share this post


Link to post
Share on other sites
duhroach    225
First thing that came to my mind. Not sure if someone has said it yet.

1. Render your scene as you would normally do. (lighting texturing etc etc etc)
2. Render your matrix texture in ortho mode( like text), and have it cover the whole screen * (in green color)
3. walla.

* Now, Your matrix texture sould actually be an array. If you figure your characters are 32x32, your array should be [screen_width/32][screen_height/32] Your control code should be in charge of randomly moving the text down and such. one idea, would be to have a single update code, that randomly starts the "character waterfall" The rest of the updating would be moving the the current character in the current spot, downwards. IE every x time amount, at spot (randomx, randomy) for random amount of time, generate new characters. so then that spot will render new characters until it's time runs out. While it's doing that, you repeat the process elsewhere. Kinda like a particle system.


Pretty straightforward and simple.
hope that helps.
~Main

==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave

[edited by - duhroach on January 31, 2003 1:56:59 PM]

Share this post


Link to post
Share on other sites