Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, howardR), 1,001 guests, and 2 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 2 of 3 1 2 3
Re: Lightmap Shader [Re: A.Russell] #84787
08/09/06 17:22
08/09/06 17:22
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Well in reality you need to think of all light maps as shadow maps.


Sphere Engine--the premier A6 graphics plugin.
Re: Lightmap Shader [Re: Matt_Aufderheide] #84788
08/10/06 20:06
08/10/06 20:06
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
This?

Code:


material mtl_lightmap
{
effect=
"

texture entSkin1;
texture entSkin2;

technique lightmap_mapping
{
pass p0
{
texture[2]=<entSkin1>;
texture[3]=<entSkin2>;


colorarg1[0]=texture; // shadow map
colorarg2[0]=diffuse; // vertex lighting
colorop[0]=add; // add vertex lighting to shadow map


colorarg1[1]=texture; // color map
colorarg2[1]=current; // (shadow map + vertex lighting)
colorop[1]=modulate2x; // modulate color map with (shadow map + vertex lighting)
resultarg[1]=temp; // output to temp register


colorarg1[2]=texture; // color map
colorop[2]=selectarg1;

magfilter[2]=linear;
minfilter[2]=linear;
mipfilter[2]=linear;
texcoordindex[2]=1;


colorarg1[3]=current; // unshaded color map
colorarg2[3]=temp; // shaded color map
colorarg0[3]=texture; // luminosity map
colorop[3]=lerp; // interpolate between shaded color map and unshaded color map depending on luminosity map

magfilter[3]=linear;
minfilter[3]=linear;
mipfilter[3]=linear;
texcoordindex[3]=1;
}
}
";
}



(The code was for worldblocks and i changed the skinsources, should work)

Re: Lightmap Shader [Re: TWO] #84789
08/10/06 22:22
08/10/06 22:22
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Thanks, but it throws an error on this line:

colorarg1[0]=texture; // shadow map

"colorarg accepts only dwords and ids"

Re: Lightmap Shader [Re: A.Russell] #84790
08/11/06 07:29
08/11/06 07:29
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
Now it works, FF effects are case-sensitive forgott it
Code:

material mtl_lightmap
{
effect=
"
texture entSkin1;
texture entSkin2;

technique lightmap_mapping
{
pass p0
{
texture[0]=<entSkin1>; //Try texture[2] if it donīt do itīs job
texture[1]=<entSkin2>; //Try texture[3]


colorArg1[0]=Texture;
colorArg2[0]=Diffuse;
colorop[0]=add; // add vertex lighting to shadow map


colorArg1[1]=Texture;
colorArg2[1]=Current; // (shadow map + vertex lighting)
colorop[1]=Modulate2x; // modulate color map with (shadow map + vertex lighting) (Test Modulate4x / Modulate2x / Modulate)
resultarg[1]=Temp; // output to temp register


colorArg1[2]=Texture;
colorOp[2]=selectArg1;

magfilter[2]=linear;
minfilter[2]=linear;
mipfilter[2]=linear;
texcoordindex[2]=1;


colorarg1[3]=Current; // unshaded color map
colorarg2[3]=Temp; // shaded color map
colorArg0[3]=Texture; // luminosity map
colorop[3]=Lerp; // interpolate between shaded color map and unshaded color map depending on luminosity map

magfilter[3]=Linear;
minfilter[3]=Linear;
mipfilter[3]=Linear;
texcoordindex[3]=1;
}
}
";
}



Re: Lightmap Shader [Re: TWO] #84791
08/11/06 14:38
08/11/06 14:38
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
Could someone here explain how to apply and use this process this in a 'for-dummies' step by step manner? (Assume I've already got the lightmap files...)

How is this different from what is being discussed here?
[urlhttp://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Board=UBB5&Number=679845&Searchpage=1&Main=674842&Words=lightmap&topic=&Search=true#Post679845[/url]

Re: Lightmap Shader [Re: JetpackMonkey] #84792
08/11/06 18:23
08/11/06 18:23
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
The shader runs now, but it doesn't add the lightmap. I could upload a test model if you want to try again.

Re: Lightmap Shader [Re: A.Russell] #84793
08/12/06 15:57
08/12/06 15:57
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
Did you trie my comments? Like renaming texture[0] to texture[2] etc?

@Jetpack_Monkey:
-Create a modell with one normal skin
-Create the lightmap somehow
-Add the lightmap the the modell as second skin
-Copy&Paste the code iīve postet
-Copy&Paste this too:

Code:

action FX_lightmapped
{
my.material=mtl_lightmap;
}



Good luck

Re: Lightmap Shader [Re: TWO] #84794
08/14/06 12:19
08/14/06 12:19
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Yes, I tried that (and I'm not quite that green), but it came out a bit strange. I could post a screen shot, but I don't think that would help much, so I have uploaded a model with a base texture and a lightmap applied for you to see for yourself: Download

Re: Lightmap Shader [Re: A.Russell] #84795
08/14/06 12:37
08/14/06 12:37
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
If I add the material it behaves as I want it to do, so whats the problem?
The shader catches the normal texture and adds the light ^^

Re: Lightmap Shader [Re: TWO] #84796
08/14/06 18:06
08/14/06 18:06
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
My bad, yes it does work. It looked different because it was a fair bit darker than I expected. Is there a parameter that can be adjusted to brighten or darken the effect to get it to look as it was lit in another application?

Page 2 of 3 1 2 3

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