2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
First useable Mirror for A6 Commercial
#40833
02/08/05 22:57
02/08/05 22:57
|
Joined: Feb 2005
Posts: 48 Hamburg, Germany
Jerome8911
OP
Newbie
|
OP
Newbie
Joined: Feb 2005
Posts: 48
Hamburg, Germany
|
Hi, The first useable Mirror for A6 Commercial, but with a little Problem. I know it isn't really a shader, but it was one before i modified it, so I hope there will be no problems. But now the code: Code:
var Video_mode = 7; var video_depth = 32; var video_screen = 1;
////////////////////////////////////////////////////////////////////////////////
entity glow_quad
{
type = <yourtex.tga>; //128*128 works best but can be any size
//this entity is always invisible.. }
//////////////////////////////////////////////////////////////////////////////// dllfunction render_backbuffer(entity);
function main() { dll_open("render_view.dll"); level_load("Shader_lvl1.wmb"); while(1) { me=glow_quad; temp.x = camera.x; temp.y = camera.y; temp.z = camera.z; camera.x = -50; camera.y = 181.000; camera.z = -65; camera.pan = -camera.pan; wait(0.1); render_backbuffer(me); camera.x = temp.x; camera.y = temp.y; camera.z = temp.z; camera.pan = -camera.pan; wait(10); } }
To use it you need the renderview.dll from Matt Aufderheide, somewhere in the forum, and you need to create a sprite. This sprite must be the yourtex.tga. This sprite is now the mirror. The problem is difficult to desribe, and it's not possible to make a screenshot of it. I think the best would be to test it. Perhaps somebody can fix the problem, but i see no possibility.
|
|
|
Re: First useable Mirror for A6 Commercial
[Re: Jerome8911]
#40834
02/10/05 08:00
02/10/05 08:00
|
Joined: Nov 2004
Posts: 832 United States, Utah
Braxton
Developer
|
Developer
Joined: Nov 2004
Posts: 832
United States, Utah
|
very nice, haven't tried it yet due to the fact that i can not find Mat's .dll
I noticed it uses a sprite, can i use a model?
Example:
Code:
entity glow_quad
{
type = <mirror.mdl>;
}
Last edited by Braxton; 02/10/05 08:14.
"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves"
- As A Man Thinketh
|
|
|
Re: First useable Mirror for A6 Commercial
[Re: Yulor]
#40836
02/11/05 00:28
02/11/05 00:28
|
Joined: Feb 2005
Posts: 48 Hamburg, Germany
Jerome8911
OP
Newbie
|
OP
Newbie
Joined: Feb 2005
Posts: 48
Hamburg, Germany
|
@ Braxton. Yes you could also assign it to a model, but in a different way, because Matts DLL makes a fast screenshot (btw.: thats the problem of the mirror).
It would be possible to realize it with a shader, for example with the watershader from steempipe. Steempipes watershader uses a extern skin for his water.
@Yulor. It isn't a fake mirror. The mirror is 100% correct. The only problem is the fast switching of the camera between two positions.
The link to the renderview.dll:
renderview
MfG
Jerome
Last edited by Jerome8911; 02/11/05 00:35.
|
|
|
Re: First useable Mirror for A6 Commercial
[Re: Jerome8911]
#40837
02/11/05 12:52
02/11/05 12:52
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
Expert
|
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
THe problem I'm having is that the mirror is mirroring what the player sees and not what the mirror "sees"
-Johnny Thrash
|
|
|
Re: First useable Mirror for A6 Commercial
[Re: Metal_Thrasher]
#40838
02/11/05 13:12
02/11/05 13:12
|
Joined: Nov 2004
Posts: 832 United States, Utah
Braxton
Developer
|
Developer
Joined: Nov 2004
Posts: 832
United States, Utah
|
I can't get it to work, the sprite is placed where i want it to be, but it is invisible and does not reflect anything.
BTW - I reanamed the sprite as mirror.pcx
"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves"
- As A Man Thinketh
|
|
|
Re: First useable Mirror for A6 Commercial
[Re: Braxton]
#40839
02/12/05 07:16
02/12/05 07:16
|
Joined: Jun 2004
Posts: 241
muralist
Member
|
Member
Joined: Jun 2004
Posts: 241
|
6.31.4 Commercial
I added the script to my level, made and placed a sprite called Mirror128.tga, added render_view.dll to the project directory, and got the errors:
Malfunction 1526 engine_getobj - function not available for DLL
Malfunction 1526 engine_getfunc - function not available for DLL
Malfunction 1526 engine_getscript - function not available for DLL
Malfunction 1526 engine_callname4 - function not available for DLL
and so on...
Heres the main script
...include <Mx_FX_Environment.wdl>;...
////////////////////////////////////////////////////////////////////////////
entity glow_quad
{
type = <Mirror128.tga>; //128*128 works best but can be any size
//this entity is always invisible..
}
dllfunction render_backbuffer(entity);
// Desc: The main() function is started at game start
function main()
{
// no level has been loaded yet...
gid01_level_state = gid01_level_not_loaded;
// entry: Warning Level (0,1, or 2)
// entry_help: Sets sensitivity to warnings (0 = none, 1 = some, 2 = all).
warn_level = 2; // announce bad texture sizes and bad wdl code
// entry: Starting Mouse Mode (0, 1, or 2)
init_mouse();
mouse_mode = 1;
game_init(); //activate some crap
Node_Init();
Mouse_Init();
change_sky();
SunMove();
MoonMove();
lightmove();
init_time();
load_water_fx();
init_animsprite();
texture_scan();
start_music();
//generate_forest();
//MP if not a single player game, wait for connection
ifdef server;
while(connection== 0) {wait(1);} // wait until level loaded and connection set
endif;
ifdef client;
while(connection== 0) {wait(1);} // wait until level loaded and connection set
endif;
//MP
if (connection !=2 && connection != 1)
{
number_players = 1;
player_number = 1;
}
on_mouse_right = null;
wait(3);
title_pan.visible = on;
black_pan.visible = on;
black_pan.transparent = on;
black_pan.alpha = 100;
while(black_pan.alpha > 0) {
black_pan.alpha = max(black_pan.alpha - 5 * time,0);// Greg was 10
wait(1);
}
media_loop(levelmus,null,100);
freeze_mode = 1;
gid01_level_state = gid01_level_not_loaded;
//center the splash screen for non-640x480 resolutions, and display it
//splashscreen.pos_x = (screen_size.x - bmap_width(splashmap))/2;
//splashscreen.pos_y = (screen_size.y - bmap_height(splashmap))/2;
//splashscreen.visible = on;
// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);
dll_open("render_view.dll");
// level_load("Shader_lvl1.wmb");
// now load the level
level_load(level_str);
wait(2);
while(1) {
me=glow_quad;
temp.x = camera.x;
temp.y = camera.y;
temp.z = camera.z;
camera.x = -50;
camera.y = 181.000;
camera.z = -65;
camera.pan = -camera.pan;
wait(0.1);
render_backbuffer(me);
camera.x = temp.x;
camera.y = temp.y;
camera.z = temp.z;
camera.pan = -camera.pan;
wait(10);
}
ifdef USE_NEWTON_GAME_DYNAMICS;
wait(1);
dll_handle = newtonHandle;
NewtonAddMap (level_str, splashscreen);
endif;
//sleep(6);
//splashscreen.visible = off;
//bmap_purge(splashmap); // remove splashscreen from video memory
gid01_level_state = gid01_level_loaded;
How do I get this to run?
|
|
|
Re: First useable Mirror for A6 Commercial
[Re: Metal_Thrasher]
#40841
03/25/05 05:55
03/25/05 05:55
|
Joined: Aug 2004
Posts: 14
Greenmonkey824
Newbie
|
Newbie
Joined: Aug 2004
Posts: 14
|
Quote:
THe problem I'm having is that the mirror is mirroring what the player sees and not what the mirror "sees"
That could be fixed with a C++ extension. I presume the mirror takes a screenshot of what its camera sees. So, what you need to do is have the screenshot flipped horizontally (like Photoshop does it) before being appended to the sprite. This is probably doable with a dll or something. However, I don't know the C++ code for this, so you might want to swipe it from an open-source Photoshop alternative.
|
|
|
|