Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 821 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Newbie
Jerome8911  Offline 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.


Visit my indieDB page for Tactics of World War One

Or download Scheherazade's Journey, made for the A8 Winter 2020 Game Jam

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 Offline
Developer
Braxton  Offline
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: Braxton] #40835
02/10/05 08:38
02/10/05 08:38
Joined: Jul 2001
Posts: 1,269
Hopewell Jct, NY
Yulor Offline
Senior Developer
Yulor  Offline
Senior Developer

Joined: Jul 2001
Posts: 1,269
Hopewell Jct, NY
I'm pretty sure documentation already exists for faking mirrors even in the standard version.

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 Offline OP
Newbie
Jerome8911  Offline 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.

Visit my indieDB page for Tactics of World War One

Or download Scheherazade's Journey, made for the A8 Winter 2020 Game Jam

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 Offline
Expert
Metal_Thrasher  Offline
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 Offline
Developer
Braxton  Offline
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 Offline
Member
muralist  Offline
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: muralist] #40840
03/19/05 03:26
03/19/05 03:26
Joined: Dec 2004
Posts: 306
Planet Earth
Wiz Offline
Senior Member
Wiz  Offline
Senior Member

Joined: Dec 2004
Posts: 306
Planet Earth
Try putting the dll_open as the first line of your main function. This solved a similar problem for me.

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
G
Greenmonkey824 Offline
Newbie
Greenmonkey824  Offline
Newbie
G

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.

Re: First useable Mirror for A6 Commercial [Re: Greenmonkey824] #40842
03/25/05 15:26
03/25/05 15:26
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
No, what he means is that it can't really be a reflection, becasue its from the camera view, not mirror view. there is no way to fix this without writing a whole rendering scheme as a DLL. All my current dll does is take the backbuffer and blit on a texture. This just a fast way of taking a low res screenshot, and is really only meant for bloom and blur effects, not mirrors.

Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1