Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, Quad, soulman3, Ayumi, steyr, 3run), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: "Texturenanimation" im MED/"textureanimation" in MED [Re: Widi] #362852
03/09/11 20:25
03/09/11 20:25
Joined: Jul 2010
Posts: 974
United Arab Emirates, Dubai
TheShooter Offline
User
TheShooter  Offline
User

Joined: Jul 2010
Posts: 974
United Arab Emirates, Dubai
@Widi: ähhm, bei mir geht das aber !!


Staub ist das neue Prime!!

Programming is like sex:
One mistake and you have to support it for the rest of your life.

Aktuelles Projekt: http://thisiswargame.bplaced.net/index.html

A8 Commercial *freu*
Re: "Texturenanimation" im MED/"textureanimation" in MED [Re: TheShooter] #362859
03/09/11 20:35
03/09/11 20:35
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
...nichts mehr zu sagen, da ist alles vergebens.

Re: "Texturenanimation" im MED/"textureanimation" in MED [Re: Widi] #362950
03/10/11 11:41
03/10/11 11:41
Joined: Apr 2007
Posts: 141
Germany
Timothy Offline
Member
Timothy  Offline
Member

Joined: Apr 2007
Posts: 141
Germany
Danke für den Tip Widi, ich war damit erfolgreich. Das Shadertutorial von Taco Cohen hat mir dabei sehr geholfen.
Hier ist der Code, falls jemand etwas ähnliches braucht:

Shader:
Code:
float4 vecSkill41; // skill41 will be used

texture entSkin1; 							// Color map.
sampler ColorMapSampler = sampler_state		// Color map sampler.
{
	Texture = <entSkin1>;
	AddressU  = Clamp;
	AddressV  = Clamp;
};

texture entSkin2; 							// Color map.
sampler ColorMapSampler2 = sampler_state		// Color map sampler.
{
	Texture = <entSkin2>;
	AddressU  = Clamp;
	AddressV  = Clamp;
};

float4 DiffusePS(	in float2 InTex		: TEXCOORD0) : COLOR
{	
	// Fetch the pixel color from the color map:
	float4 Color = tex2D(ColorMapSampler, InTex) * (vecSkill41.x/100); // skin1-strength is changed by skill41
	
	float4 Color2 = tex2D(ColorMapSampler2, InTex)  * (1-vecSkill41.x/100); // skin2-strength is changed by skill41
	
	// Calculate final color:
	return Color + Color2;
}

technique DiffuseTechnique
{
	pass P0
	{
		PixelShader  = compile ps_1_0 DiffusePS();
	}
}



Und in der Entity-Funktion benutzt man
Code:
my.skill41 = floatv(*Alpha-Wert Skin1 von 0-100*); // skill41 geht in den Shader - Prozentzahl Skin1 (Bsp: skill41 = 35 dann Skin1.alpha = 35; Skin2.alpha = 65;)



MfG

Page 2 of 2 1 2

Moderated by  HeelX, rvL_eXile 

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