Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, AndrewAMD, TedMar), 837 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[REQ]Enviroment mapping - bright (add color) #41972
03/01/05 01:25
03/01/05 01:25
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline OP
Expert
EX Citer  Offline OP
Expert

Joined: May 2002
Posts: 2,541
Berlin
Hello,

Can anyone tell me how to change the enviroment mapping shader to add the enviroment map to the model skin? It should work like transparent particles with bright = ON, so that their color is added to the background.

EX Citer


:L
Re: [REQ]Enviroment mapping - bright (add color) [Re: EX Citer] #41973
03/01/05 16:27
03/01/05 16:27
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
show the shader you are using.. it will just be a small change

Re: [REQ]Enviroment mapping - bright (add color) [Re: ello] #41974
03/02/05 01:50
03/02/05 01:50
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline OP
Expert
EX Citer  Offline OP
Expert

Joined: May 2002
Posts: 2,541
Berlin
Hello Ello

I tried what you sent me via PM but A) I did it wrong, or B) it didn´t worked. Depending on the value the model was dark (ambient = -100) or not shaded (ambient=100) and transparent.

I am using this code:

bmap acube=<tropic+6.tga>;

function mtl_envmap_view()
{
mat_set(mtl.matrix,matViewInv);
mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}

function mtl_envmap_init()
{
//...maybe you should copy the mat_model properties here...
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_envmap_view;
mtl.enable_view=on;
}

material mtl_env1map
{
skin1=acube;
event=mtl_envmap_init;

effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass p0
{
texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;

zWriteEnable=true;
alphaBlendEnable=false;

colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;

colorArg1[1]=Texture;
colorOp[1]=blendCurrentAlpha;
addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}

and this

material mtl_env2map
{
skin1=acube;
event=mtl_envmap_init;

effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass p0
{
texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;

zWriteEnable=true;
alphaBlendEnable=false;

colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;

colorArg1[1]=Texture;
textureFactor=0x40FFFFFF; // -> C0=75%, 80=50%, 40=25% //delete this
colorOp[1]=blendFactorAlpha; //and this for alpha map
addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}

EX Citer


:L
Re: [REQ]Enviroment mapping - bright (add color) [Re: EX Citer] #41975
03/02/05 05:52
03/02/05 05:52
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
check : colorOp[1]=blendCurrentAlpha;

replace the bendCurrentAlpha maybe by "addSmooth"

and maybe you like to replace it by all of the following just to see how they work out:)

i hope this helps you reach the desired look

taken from directX documentation for c++ :

In Antwort auf:


D3DTOP_DISABLE = 1,
D3DTOP_SELECTARG1 = 2,
D3DTOP_SELECTARG2 = 3,
D3DTOP_MODULATE = 4,
D3DTOP_MODULATE2X = 5,
D3DTOP_MODULATE4X = 6,
D3DTOP_ADD = 7,
D3DTOP_ADDSIGNED = 8,
D3DTOP_ADDSIGNED2X = 9,
D3DTOP_SUBTRACT = 10,
D3DTOP_ADDSMOOTH = 11,
D3DTOP_BLENDDIFFUSEALPHA = 12,
D3DTOP_BLENDTEXTUREALPHA = 13,
D3DTOP_BLENDFACTORALPHA = 14,
D3DTOP_BLENDTEXTUREALPHAPM = 15,
D3DTOP_BLENDCURRENTALPHA = 16,
D3DTOP_PREMODULATE = 17,
D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
D3DTOP_MODULATECOLOR_ADDALPHA = 19,
D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
D3DTOP_BUMPENVMAP = 22,
D3DTOP_BUMPENVMAPLUMINANCE = 23,
D3DTOP_DOTPRODUCT3 = 24,
D3DTOP_MULTIPLYADD = 25,
D3DTOP_LERP = 26,
D3DTOP_FORCE_DWORD = 0x7fffffff






ps: of course without the d3dtop_ insert

Last edited by ello; 03/02/05 05:55.
Re: [REQ]Enviroment mapping - bright (add color) [Re: ello] #41976
03/04/05 01:16
03/04/05 01:16
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline OP
Expert
EX Citer  Offline OP
Expert

Joined: May 2002
Posts: 2,541
Berlin
Hey Ello,
Hab deine Email bekommen, und diese Befehle getested. Die sind echt Gold wert "Add" ist genau das was ich gesucht habe, nur ist jetzt das Problem das ich nicht weiß wie man die Befehle mit anderen Eingaben kombiniert wie zum Beispiel Transparenz der Eviromentmap (Alphakanal der Skin bzw AlphaWert). Das heißt die Enviromentmap wird jetzt bright auf das Model projeziert aber das mit voller Deckkraft. Ob es wirklich hinzuaddiert ist werde ich bald nochmal testen, aber bis jetzt sieht es so aus. Ausserdem wäre es noch cooler wenn man zwei Enviromentmaps hinzufügen könnte, eine als Spiegelung ohne Add (also wie bisher) und eine Enviromentlights map die hinzuaddiert über Skin1 und Enviromentmap1 wird.
Naja, aber ich wäre schon froh wenn ich das Alpha mit AddBefehl einstellen könnte
Mit "Invert" kann man auch geniale Sachen machen besonders wenn man es teilweise auf den Screen rendert, zB als transparenten Schriftzug oder Blitzeffekt.


:L
Re: [REQ]Enviroment mapping - bright (add color) [Re: EX Citer] #41977
03/04/05 16:41
03/04/05 16:41
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
setz mal alphaBlendEnable=true; und dann kannst du mit BlendOp, srcBlend und destBlend noch weitere "schweinereien" machen;)
ich empfehle dir die directX documentation für c++ runterzuladen(falls dus noch nicht gemacht hast) da findest du ne menge nützlicher informationen..


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