Hello, what is the best way to make a mirror in 3D Rad? I tried a plan with a white texture and the glass shader but that did not effectively make reflections only modified the opacity.
This forum is now archived!
- Welcome to the archive!
News:
The 3DRad community can be found at classdev.net.
- 3D Rad - Free 3D game maker - Forum >
- General Category >
- 3D Rad - Artist's Discussion Forum >
- Creating a realistic mirror
Author Topic: Creating a realistic mirror (Read 2646 times)
jestermon
The only "true" mirror you can get is to use another camera, placed somewhere in a corner of your screen. Once (if ever) "render to texture" becomes available, then you could apply the texture to a surface.
Sure ok I follow. Yea I was looking in the coding documentation to see if there was a code to do that. What about modifiying the glass shader? Or writing my own shader is that a possibility?
http://3drad.com/custom-shaders.php
shader documentation
shader documentation
You can do mirror with default the built-in shaders (0001_pp_smooth) using envmapping (reflection factor to 1) and a small script to set env focus.
Code: [Select]
Vector3 v1,v2;
int CAMERA=OBJ_0;
int OBJECTSKINMESH=OBJ_22;
float FineTuneRefraction = 3.75f; //adjust relative to camera y.
iObjectLocation(CAMERA,v1);//camera
iObjectLocation(OBJECTSKINMESH,v2);//flat plane
iObjectEnvMapFocusSet(OBJECTSKINMESH,Vector3(v1.x,v1.y+((v2.y/2.0f)-FineTuneRefraction),v1.z)); //set focus
You can do mirror with default the built-in shaders (0001_pp_smooth) using envmapping (reflection factor to 1) and a small script to set env focus.Code: [Select]Vector3 v1,v2;
int CAMERA=OBJ_0;
int OBJECTSKINMESH=OBJ_22;
float FineTuneRefraction = 3.75f; //adjust relative to camera y.
iObjectLocation(CAMERA,v1);//camera
iObjectLocation(OBJECTSKINMESH,v2);//flat plane
iObjectEnvMapFocusSet(OBJECTSKINMESH,Vector3(v1.x,v1.y+((v2.y/2.0f)-FineTuneRefraction),v1.z)); //set focus
Thanks for the response. Ok so I turned environment map on and I added this script but nothing happens. I get blue clouds in my mirror
Code: [Select]
void Main()
{
Vector3 v1,v2;
int CAMERA=OBJ_0;
int OBJECTSKINMESH=OBJ_44;
float FineTuneRefraction = 1.31912f; //adjust relative to camera y.
iObjectLocation(CAMERA,v1);//camera
iObjectLocation(OBJECTSKINMESH,v2);//Dressing Room
iObjectEnvMapFocusSet(OBJECTSKINMESH,Vector3(v1.x,v1.y+((v2.y/2.0f)-FineTuneRefraction),v1.z)); //set focus
}
PsychoWeasel9
Set the envmap refresh rate, so that the reflection object actually shows your scene. You also have to select "display in reflections" for skinmesh/skyboxes, etc
60 or 75 get a smooth reflection.
Also the higher resolution your envmap is the sharper reflection will be..
Also the more vertices in the "mirror" skinmesh you have the more accurate the reflection will be.
Here is a demo using default objects (saved using rad 7.11)
Also the higher resolution your envmap is the sharper reflection will be..
Also the more vertices in the "mirror" skinmesh you have the more accurate the reflection will be.
Here is a demo using default objects (saved using rad 7.11)
Shad... you never cease to amaze...
that scene looks great...
i never thought about using the default shaders for a mirror effect... thanks for the technique...
(i've been outta the loop for a few days... in fed court arguing a case)
--Mike
that scene looks great...
i never thought about using the default shaders for a mirror effect... thanks for the technique...
(i've been outta the loop for a few days... in fed court arguing a case)
--Mike
60 or 75 get a smooth reflection.
Also the higher resolution your envmap is the sharper reflection will be..
Also the more vertices in the "mirror" skinmesh you have the more accurate the reflection will be.
Here is a demo using default objects (saved using rad 7.11)
Ok my reflection is still blurry and zoomed in. No idea why though.
Pages: [1] 2