Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 6 of 6 1 2 3 4 5 6
Re: ingame light mapper [Re: DavidLancaster] #135220
06/20/07 13:42
06/20/07 13:42
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Quote:

Wow Pappenheimer! May I ask how you got the rocks looking smooth? High Poly? And how you got the 2 textures on the rock to transition smoothly? Thanks!








The procedure goes as I mentioned above! I started with the square 8x8 of a terrain, added a texture, changed it to model etc.

One texture is simply copied into the other, then rubbed out where it isn't needed.


Quote:

I start with a small terrain, let's say 8x8,
then I add a texture,
then convert it to mdl,
build blocks out of this plate which give the rough shape of a canyon or whatever gives the natural environement that I try to achieve;
after that, I connect the plates,
and deform their blocky shape to get more stony and scarp-like shapes...





Last edited by Pappenheimer; 06/20/07 13:44.
Re: ingame light mapper [Re: Pappenheimer] #135221
06/21/07 10:02
06/21/07 10:02
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
Thanks so much Pappenheimer! You rock! May I ask where you got those textures from?

Re: ingame light mapper [Re: DavidLancaster] #135222
06/21/07 10:12
06/21/07 10:12
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Just a fast way to get the model with a second uv-map:

Save the model with its name and an addition like _lm,
then click through the skins and groups in the Skin Editor
and change the skinsettings, that all parts of the mesh share the texture of the first one,
choose all, and scale them down to the tenth or so of the skin texture
(maybe, you have to do this several times switching from group to group etc.),
then switch to the 3D Editor and choose a single triangle of that side
that you want to be mapped in the upper left corner of your lightmap,
(Options -> Sync Skin Selection must be checked)
switch back to the Skin Editor and click Select connected,
move that part of the uv to the upper left corner,
switch to 3D Editor again, choose the next part which you want to line up the first one
etc. etc.
Save the model again.


@DavidLancaster : From my photographs, made seamless in the Seamless Texture Generator.

Last edited by Pappenheimer; 06/21/07 10:45.
Re: ingame light mapper [Re: Pappenheimer] #135223
07/31/07 22:39
07/31/07 22:39
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Once again: A hurray to the programmer of the meshplugin: Long live Ventilator!



I just try to force me to write down the workflow of
how to achieve something like this simply
with MED, WED and ventilator's meshplugin and lightmapper.
Anyone interested?

Re: ingame light mapper [Re: Pappenheimer] #135224
07/31/07 22:50
07/31/07 22:50
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
beautiful!

Re: ingame light mapper [Re: JetpackMonkey] #135225
07/31/07 23:06
07/31/07 23:06
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Wow thats neat


Click and join the 3dgs irc community!
Room: #3dgs
Re: ingame light mapper [Re: Pappenheimer] #135226
07/31/07 23:12
07/31/07 23:12
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Quote:

I just try to force me to write down the workflow of
how to achieve something like this simply
with MED, WED and ventilator's meshplugin and lightmapper.
Anyone interested?




Me!!! That would indeed ba a great contribution, Pappenheimer!


Always learn from history, to be sure you make the same mistakes again...
Re: ingame light mapper [Re: Uhrwerk] #135227
08/16/07 20:10
08/16/07 20:10
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Just a short addition to the things that I already mentioned in this thread about the workflow, because I won't find time to give you a step by step explanation within the next two weeks:

Beside the model which shall have a second uv-map for the shadowing you need the second version of the model with a mapping of its skin where every polygon has its own place of the map!

Then you need two scripts. One for getting the mesh-file of the model's second version and producing and ingame-editing of the lightmap, and saving the lightmap as a png-file. And a second script for including the already shadowed model in a game.

Assign the needed script in WED, you can't use them both at once!





#1 Script(note, you have to check the model's polygon flag and flag8 in the properties:

It is the light.wdl of ventilator's lightmapper, there is only one small addition in the function 'lightallentities':


function lightallentities()//light the entities and save them as pngs
{
tempentity = ent_next(0);
while(tempentity != 0)
{
if(tempentity.flag8)
{
tempmaterial = tempentity.material;
l_light(tempentity, tempmaterial.skin1);
str_for_entfile(tempstring, tempentity);
str_trunc(tempstring, 4);
str_cat(tempstring, "_lm.png");
bmap_save(tempmaterial.skin1,tempstring);
wait(2);
}
tempentity = ent_next(tempentity);
}
}








-----------------------------------------------------------------
#2 Script is this:

var video_mode = 8;

plugindir = ".";
dllfunction ent_exportmesh(entity, filename);
dllfunction ent_importmesh(entity, filename);
dllfunction ent_loadseconduvset(entity1, entity2);

material* tempmaterial;
entity* tempentity;
entity* tempentity2;
string tempstring;

//----------------------------------------------------------------------------- mtl_lightmap

material mtl_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;
}
}
";
}



//----------------------------------------------------------------------------- main
function file_exists(filename)
{
var filehandle;
filehandle = file_open_read(filename);
if(filehandle)
{
file_close(filehandle);
return(1);
}
else
{
return(0);
}
}

string tempstring1;
string tempstring2;
material* tempmaterial;

function applylightmaps()
{
you = ent_next(0);
while(you != 0)
{
str_for_entfile(tempstring1, you);
str_trunc(tempstring1, 4);
str_cpy(tempstring2, tempstring1);
str_cat(tempstring1, "_lm.mdl");
str_cat(tempstring2, "_lm.png");

if(file_exists(tempstring1) && file_exists(tempstring2))
{
you.material = mtl_create(); // they should be removed again when changing the level
tempmaterial = you.material;
tempmaterial.effect = mtl_lightmap.effect;
tempmaterial.skin1 = bmap_create(tempstring2); // they should be removed again when changing the level
tempentity = ent_create(tempstring1, nullvector, 0);
ent_loadseconduvset(you, tempentity);
ent_remove(tempentity);
}
you = ent_next(you);
}
}

function main()
{
wait(3);
level_load("example.wmb");
wait(1);

vec_set(sky_color, vector(250, 175, 75));

vec_set(sun_angle, vector(160, -35, 0));
sun_light = 20;

vec_set(camera.x, vector(300, 0, 200));
camera.pan = 180;

applylightmaps();
}




-----------------------------------------------------------------------
Again, thanks to ventilator, who helped me to complete these scripts!

(The shadowmap is saved as png, because it is the only format that the directx function saves without a mistake, if you want to save it as tga or bmp, you can change that in the script, but after saving in that formats, you have to open them each in a grafic tool and save them again, to get the correct results!)

Re: ingame light mapper [Re: Pappenheimer] #238691
11/29/08 11:20
11/29/08 11:20
Joined: Oct 2008
Posts: 679
Germany
Ayumi Offline
User
Ayumi  Offline
User

Joined: Oct 2008
Posts: 679
Germany
@Pappenheimer

leere mal bitte deinen message ordner.
Ich hätte da mal eine Frage:-)

Re: ingame light mapper [Re: ventilator] #238697
11/29/08 12:49
11/29/08 12:49
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline
Senior Member
Roel  Offline
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
To get rid of artifarcts, you could use a small margin between two uv triangles that shouldn't merge.
Blender uses this option, and I think the margin should be around 2 pixels.
Another thing that could cause artifarcts is mip mapping, but I think you already disabled it

Last edited by Roel; 11/29/08 12:50.

Check out the throwing game here: The throwing game
Page 6 of 6 1 2 3 4 5 6

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