1 registered members (AndrewAMD),
1,213
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Real DX9 Reflection
[Re: Drew]
#37742
12/17/04 20:08
12/17/04 20:08
|
Joined: Nov 2004
Posts: 7,121 Potsdam, Brandenburg, Germany
Machinery_Frank
Senior Expert
|
Senior Expert
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
|
... not only assembling. Please create a plugin and an easy way to use (little documentation). Then feel free to make an affordable price. That work should be honored. I would pay for it.
And if there is an option to choose between the render to texture mode and the slower one then would everyone be very happy.
Models, Textures and Games from Dexsoft
|
|
|
Re: Real DX9 Reflection
[Re: Josh_Arldt]
#37745
12/26/04 04:40
12/26/04 04:40
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
Expert
|
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
Quote:
Use what Pappenheimer suggested. This saves the bitmaps as a cubemap instead of shot1, shot2 ect...
savedir="output"; var_nsave fh; bmap* canvas; bmap* b_render1; bmap* b_render2; bmap* b_render3; bmap* b_render4; bmap* b_render5; bmap* b_render6; var cubenumber = 0; var directions[18] = 180, 0, 0, 90, 0, 0, 0, 0, 0, -90, 0, 0, 90, -90, 0, 90, 90, 0; string tempstring1; string tempstring2; string _ts_;
//----------------------------------------------------------------------------- write_cubemap function write8(byte) // write char { file_asc_write(fh, byte); }
function write16(short) // write unsigned short { file_asc_write(fh, short&255); file_asc_write(fh, (short>>8)&255); }
function str_padding(str, number, padding) { str_for_num(_ts_, number); var i = 0; i = padding - str_len(_ts_); while(i > 0) { str_cat(str, "0"); i-=1; } str_cat(str, _ts_); }
function write_cubemap() { var i; var xx; var yy; var format; var pixel; var pixelalpha; var canvas_size[2];
canvas_size.x = bmap_width(b_render1); canvas_size.y = bmap_height(b_render1); format = bmap_lock(b_render1, 0); bmap_lock(b_render2, 0); bmap_lock(b_render3, 0); bmap_lock(b_render4, 0); bmap_lock(b_render5, 0); bmap_lock(b_render6, 0);
str_cpy(tempstring1, "cubemap"); str_padding(tempstring1, cubenumber, 4); str_cat(tempstring1, "+6.tga"); fh = file_open_write(tempstring1); cubenumber+=1; //--------------------------------------------------------write header write8(0); write8(0); write8(2); // image type write16(0); write16(0); write8(0); write16(0); write16(0); write16(canvas_size.x * 6); // width write16(canvas_size.y); // height write8(24); // color depth write8(0); //--------------------------------------------------------write image data yy = canvas_size.y - 1; while(yy >= 0) { i = 0; while(i < 6) { if(i==0){canvas=b_render1;} if(i==1){canvas=b_render2;} if(i==2){canvas=b_render3;} if(i==3){canvas=b_render4;} if(i==4){canvas=b_render5;} if(i==5){canvas=b_render6;} xx = 0; while(xx < canvas_size.x) { pixel = pixel_for_bmap(canvas, xx, yy); pixel_to_vec(temp, pixelalpha, format, pixel); write8(temp.x); // b write8(temp.y); // g write8(temp.z); // r xx+=1; } i+=1; } yy-=1; } file_close(fh); bmap_unlock(b_render1); bmap_unlock(b_render2); bmap_unlock(b_render3); bmap_unlock(b_render4); bmap_unlock(b_render5); bmap_unlock(b_render6); }
//----------------------------------------------------------------------------- capture_cubemap function capture_cubemap { var old_arc; var old_x; var old_y; var old_screen;
b_render1 = bmap_create("render.tga"); // use a 256x256 tga for example -> determines cube map size b_render2 = bmap_create("render.tga"); b_render3 = bmap_create("render.tga"); b_render4 = bmap_create("render.tga"); b_render5 = bmap_create("render.tga"); b_render6 = bmap_create("render.tga");
old_arc = camera.arc; old_x = screen_size.x; old_y = screen_size.y; old_screen = video_screen;
camera.arc = 90; video_set(256, 256, 32, 2); // should be same resolution as render.tga
freeze_mode = on; vec_set(camera.pan, directions[0]); wait(1); bmap_for_screen(b_render1,1,0); vec_set(camera.pan, directions[3]); wait(1); bmap_for_screen(b_render2,1,0); vec_set(camera.pan, directions[6]); wait(1); bmap_for_screen(b_render3,1,0); vec_set(camera.pan, directions[9]); wait(1); bmap_for_screen(b_render4,1,0); vec_set(camera.pan, directions[12]); wait(1); bmap_for_screen(b_render5,1,0); vec_set(camera.pan, directions[15]); wait(1); bmap_for_screen(b_render6,1,0); freeze_mode = off;
wait(1); write_cubemap();
wait(1); camera.arc = old_arc; video_set(old_x, old_y, 32, old_screen); }
on_c=capture_cubemap;
Now, what kind of action will attach this screenshot to an entity?
-Johnny Thrash
|
|
|
Re: Real DX9 Reflection
[Re: Metal_Thrasher]
#37746
12/26/04 10:38
12/26/04 10:38
|
Joined: Sep 2004
Posts: 1,214 Austin, Texas
Josh_Arldt
Senior Developer
|
Senior Developer
Joined: Sep 2004
Posts: 1,214
Austin, Texas
|
Quote:
str_cpy(tempstring1, "cubemap");
I believe this is the name of the cubemap it writes. It writes it as cubemap+6.tga. Just use a cubemap shader and change the cubemap to this one.
|
|
|
Re: Real DX9 Reflection
[Re: Josh_Arldt]
#37747
12/28/04 12:00
12/28/04 12:00
|
Joined: Nov 2004
Posts: 832 United States, Utah
Braxton
Developer
|
Developer
Joined: Nov 2004
Posts: 832
United States, Utah
|
Is the original shader for C-Script or C++.
"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: Real DX9 Reflection
[Re: Braxton]
#37748
12/31/04 08:02
12/31/04 08:02
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
Expert
|
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
The very first piost is C++ I think, the filename was something.cpp.
-Johnny Thrash
|
|
|
Re: Real DX9 Reflection
[Re: Metal_Thrasher]
#37749
12/31/04 09:42
12/31/04 09:42
|
Joined: Nov 2004
Posts: 832 United States, Utah
Braxton
Developer
|
Developer
Joined: Nov 2004
Posts: 832
United States, Utah
|
How do we use HumanSandBags shager in a 3DGS level.
"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: Real DX9 Reflection
[Re: Braxton]
#37750
12/31/04 09:46
12/31/04 09:46
|
Joined: Nov 2004
Posts: 832 United States, Utah
Braxton
Developer
|
Developer
Joined: Nov 2004
Posts: 832
United States, Utah
|
I mean I pasted his (HumanSandBag) code in a new script file and then saved it as DX9.wdl now when I load the level and try to add the code to the player (in behaviors) nothing shows up. I have added the DX9 code to my A^ template code externally. How can I fix this???
"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: Real DX9 Reflection
[Re: Braxton]
#37751
12/31/04 12:05
12/31/04 12:05
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
Expert
|
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
Well, HSB's code there is for taking the cobe map picture...the actual code for it is on the wiki page on the bottom of this page. I just used sky texture instead of a cobe map and I got a very pretty crome-effect.
-Johnny Thrash
|
|
|
|