Reflective Texture

Barclay
Unregistered
 
Post: #1
How do you create a reflective texture for a model, etc.

Thanks!
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #2
Are you talking about a dynamic reflection map? In that case, you're going to need to render the scene 6 times: once for each side of a cube from that object's point of view. I don't know the exact code for that, but I can give you an idea of what to do if that's what you wanted.
Quote this message in a reply
Member
Posts: 86
Joined: 2005.01
Post: #3
Do you mean a cube map, or real time reflection (which will probably need some fudging with the stencil buffer; I'm not really sure as I haven't done this).

Newest game: Glow, a sci-fi RPG with lots of zombie bashing. Get it: OS X
Quote this message in a reply
Member
Posts: 161
Joined: 2005.07
Post: #4
The answer to your question depends on what you're actually asking us.

1) If you want a shiny surface, increase the specular component for the material.
2) If you want something more like a mirror, you render the scene backwards on the opposite side of the "mirror", and the mirror is actually just a transparent surface. Depending on the situation, stencil testing may or may not be needed.
3) Some games (like Burnout 3 for Xbox) use prerendered textures representing the outside world, then texture it onto the windshields of the cars to fake a reflection. As the car moves, they just shift the texture accordingly.
4) Real dynamic reflections can also be handled like akb285 said.
Quote this message in a reply
Barclay
Unregistered
 
Post: #5
What I meant was: how do you create vertex shader (.vert) files, this is focused toward Dim3, but no one over there knows how to create anything like them over there.

Thanks!
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #6
Do you mean just general vertex shaders? For that, you will need to learn GLSL. (I believe that's what Dim3 uses)

BTW, what does this have to do with reflective textures? Blink
Quote this message in a reply
Barclay
Unregistered
 
Post: #7
Nothing, I was thinking of something else.

Anyway, what program can do GDSL?

Thanks!
Quote this message in a reply
Member
Posts: 86
Joined: 2005.01
Post: #8
I don't know about the internals of Dim3, but you have to write GLSL shaders by hand. Give lighthouse3d's articles a try.

Newest game: Glow, a sci-fi RPG with lots of zombie bashing. Get it: OS X
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #9
That would be GLSL. GLSL is a shader programming language used by OpenGL, which you can write in any text editor. The Shader Builder that comes with the developer tools is a very useful tool, however, so you might want to think about using that. Regardless, you'll need to learn how to use it first. Rasp
Quote this message in a reply
Member
Posts: 168
Joined: 2004.10
Post: #10
How exactly do you plan to do this without scriptable render to textures on Dim3?
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #11
These are the kinds of things that you may be able to do on a limited scale with Dim3, but if you were to do anything complex, you will need to make your own engine. For example, having a static reflection map would be fine, but without a scriptable render to texture, you won't be able to do a dynamic one. GLSL is the same way: you won't be able to do many amazing effects with textures, especially with the weird way that it handles normals etc. It's the price you pay for having most of the work done for you.
Quote this message in a reply
Member
Posts: 168
Joined: 2004.10
Post: #12
Making a new engine is a bit much with Dim3 being FOSS and all.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #13
Not necessarily an entire game engine, but possibly a new graphics engine. It really depends on what is required. Hell, I don't even know if it would be possible to do any reflection maps in Dim3, now that I think of it, because of the weird handling of the normals.
Quote this message in a reply
Post Reply