Reflection
Blitz3D Forums/Blitz3D Programming/Reflection
| ||
How do I make a texture that reflects?? |
| ||
you make a cubemap, or if you know how to build a spheremap, that could work too. Or, you could simply snapshot a render into a texture and use that as a second texture layer and alpha blend. There are other ways also, but already you have the idea. There is no easy way. |
| ||
What is cube mapping? I've heard of it before, but I never figured out what it is or how to do it. |
| ||
there are some examples in your blitz3d folder. try them. also the help files should be useful! these are the commands you might use: CreateTexture SetCubeMode SetCubeFace |
| ||
http://www.blitzbasic.com/codearcs/codearcs.php?code=1524 Andy |
| ||
In that example, if you want proper mirror brightness, fix it by replacing the brush1 code with this:; brushes brush1=CreateBrush() BrushTexture brush1,tex ;BrushShininess brush1,1 BrushFX brush1,1 will make the mirror texture fullbright. |
| ||
eh - i just got the idea that he dont wanna do complex reflection. i think what you want is a mirror use CreateMirror()in any of your projects and watch ;D |
| ||
>In that example, if you want proper mirror brightness, fix >it by replacing the brush1 code with this: Thanks mate. This was always development code, so anything beyond looking about right was good enough for me. But I updated it anyway. Andy |
| ||
thanks everyone but it turns out i don't have a good enough graphics card to support reflections. |
| ||
>thanks everyone but it turns out i don't have a good >enough graphics card to support reflections. Why not? Andy |
| ||
you dont have a matrox graphic card, do you? cause if you do, get yourself a new pc. |
| ||
There are various kinds of reflections. A very simple one, that will only reflect a light source, useful for eg. a snooker sphere: Entityshininess entity,1.0 Cubemapping requires the special Caps, as your card doesn't offer. It is also pretty tricky to use it the right way, it's slow and the resolution of the reflection is most times lower than the screen (something I'd consider an artefact) Spheremapping won't need the caps as cubemapping! There's an example in your installation folder named "TheHead.bb", an excellent sample on Spheremapping! Finally there's CreateMirror, that will create an infinite plane that will reflect everything, unfortunately also the things below it to the upper side. So you may use this mirror as the most bottom object in your level, or use Tom's dx7 dll that allows to Clip Rendering at a certain Y height. For a simple reflection effect, eg. a sword made of steel I'd suggest to use Spheremapping, it's fast and looks ok. |