Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, EternallyCurious, Petra, 1 invisible), 764 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 3 of 6 1 2 3 4 5 6
Re: supertrace plugin / second uv-set plugin [Re: fogman] #134240
06/09/07 14:10
06/09/07 14:10
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Holy grail... nice one

Re: supertrace plugin / second uv-set plugin [Re: fogman] #134241
06/09/07 14:14
06/09/07 14:14
Joined: Jun 2003
Posts: 1,017
Germany
T
Thomas_Nitschke Offline
Senior Developer
Thomas_Nitschke  Offline
Senior Developer
T

Joined: Jun 2003
Posts: 1,017
Germany
It seems I cannot rate you higher than this. Damn the forum software
Congratulations ventilator, this is really one of the greatest contributions ever seen around here.


Formerly known as The Matrix - ICQ 170408644 I've been here for much longer than most people think. So where's my "Expert" status?
Re: supertrace plugin / second uv-set plugin [Re: Thomas_Nitschke] #134242
06/10/07 06:42
06/10/07 06:42
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
a small addition:



now it supports multiple lights and the lighting equation takes color and falloff into account. shadows can be enabled or disabled for lights (i always wanted this possibility in wed! it makes using fill lights much easier.).

looks quite promising so far. hopefully no problems i didn't think of will arise. it's a pity nobody started sooner with something like this.

Re: supertrace plugin / second uv-set plugin [Re: ventilator] #134243
06/10/07 06:46
06/10/07 06:46
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
So this is all generated from WED? And it supports static lights? And can be generated from WED?

If this is all true, then you are truly the master. If not, your still the master, lol. That is, until I catch up with you


xXxGuitar511
- Programmer
Re: supertrace plugin / second uv-set plugin [Re: xXxGuitar511] #134244
06/10/07 06:54
06/10/07 06:54
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
no, it's not generated from WED. after loading the level the light maps get calculated in the engine.

i use entities (small sphere models - see the white dot above) for setting the lights and they could be placed in WED of course. i didn't find a good way to access the real WED lights per script.

in the engine you can change the light position and settings and let the light map update immediately but i didn't work on a light editor yet.

...
maybe i should start a new thread about the ingame light mapper since it is work in progress and not directly related to the two plugins of this thread.

Re: supertrace plugin / second uv-set plugin [Re: ventilator] #134245
06/10/07 07:07
06/10/07 07:07
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
...Sounds like a good idea


xXxGuitar511
- Programmer
Re: supertrace plugin / second uv-set plugin [Re: ventilator] #134246
06/11/07 01:44
06/11/07 01:44
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
Wow, this sounds great. Probably the best part is that it automatically generates the second uvmap(without having to export 2 models). I'm sure many users would find it extremely useful. Looking forward to purchasing it when done.


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: supertrace plugin / second uv-set plugin [Re: William] #134247
06/16/07 12:20
06/16/07 12:20
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
Hey Ventilator

I can get your script to work, but when I tried implementing it myself I got an error 'crash in bmap_getcolor'.

Any ideas? Thank you!

Code:

plugindir = ".";

//////////////////////////////
// supertrace
//////////////////////////////
dllfunction drawuvs(entity, &positionandscale, &color, alpha); // slow!
dllfunction tc_beginbuild();
dllfunction tc_addentity(entity);
dllfunction tc_endbuild();
dllfunction supertrace(&p0, &p1);
dllfunction bmap_getcolor(bitmap, &recolor, xx, yy); // much faster than pixel_for_bmap() (doesn't work with dds!)
var trace_uv1[3];
var trace_uv2[3];


//////////////////////////////
// mesh lightmapping
//////////////////////////////

dllfunction ent_loadseconduvset(entity1, entity2);
dllfunction ent_exportmesh(entity, filename);
dllfunction ent_importmesh(entity, filename);

material* tempmaterial;

bmap bmap_lightmap = "pingvillage_lm.tga";

material mtl_lightmap
{
skin1 = bmap_lightmap;

effect=
"
texture mtlSkin1;
texture entSkin1;

technique t0
{
pass p0
{
Texture[0]=<mtlSkin1>;
Texture[1]=<entSkin1>;

// mix light map with dynamic lighting
TexCoordIndex[0] = 1;
ColorArg1[0] = Texture;
ColorOp[0] = AddSigned;
ColorArg2[0] = Diffuse;

// apply lighting to texture
TexCoordIndex[1] = 0;
ColorArg1[1] = Texture;
ColorOp[1] = Modulate2x;
ColorArg2[1] = Current;
}
}
";
}

var color[3];
ACTION lightmapped_mesh {
my.scale_z *= 1.12;
my.nofog = on;
my.polygon = on;
my.unlit = on;
my.ambient = 80;

my.material = mtl_lightmap; // assign light map material
ent_importmesh(my, "pingvillage_lm.mesh"); // load and assign the previously saved mesh which contains both uv-sets


/* temp_ent = ent_create("pingvillage_lm.mdl", nullvector, 0); // load model with light map uv-set
ent_loadseconduvset(my,temp_ent); // generate and assign a new mesh with both uv-sets
ent_remove(temp_ent); // tempentity isn't needed anymore
ent_exportmesh(my,"pingvillage_lm.mesh"); // save mesh with both uv-sets for reuse */

tc_beginbuild();
tc_addentity(my);
tc_endbuild();

WHILE (1) {
WHILE (!player) { wait(1); }
temp_ent = ptr_for_handle(player.animated_attach);
you = supertrace(vector(player.x,player.y,player.z),vector(player.x,player.y,player.z - 4000));
// you = supertrace(vector(camera.x, camera.y, camera.z), vector(camera.x, camera.y, -10000));
if (you)
{
bmap_getcolor(bmap_lightmap, color, trace_uv2.x * 1024, trace_uv2.y * 1024);
temp_ent.light = on;
temp_ent.blue = color.blue;
temp_ent.green = color.green;
temp_ent.red = color.red;
}
wait(1);
}
}



Re: supertrace plugin / second uv-set plugin [Re: DavidLancaster] #134248
06/16/07 12:34
06/16/07 12:34
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
does your light map have an alpha channel? bmap_getcolor at the moment only works with 888 format but with alpha channel the format is 8888.

Re: supertrace plugin / second uv-set plugin [Re: ventilator] #134249
06/16/07 13:50
06/16/07 13:50
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
No it doesn't have an alpha channel, I get the 888 error if I give it one, it just bypasses that and gives me the crash error, same mesh works in your demo, I've played around with it all, can't seem to find a solution. Let me know if you have any ideas. Thank you!

Page 3 of 6 1 2 3 4 5 6

Moderated by  adoado, checkbutton, mk_1, Perro 

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