Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
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
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
shader for tiling texture ? #360576
02/25/11 02:43
02/25/11 02:43
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)


Basically i'd like a shader that wont scale the texture when I scale the model, it will instead tile with the model as it scales.

I think I asked for this before but I dont think I got a working response or maybe I was too much of a noob back then to make it work, then again, maybe i'm too much of a noob now since am requesting this rather than doing it grin but bare with me please wink

Re: shader for tiling texture ? [Re: darkinferno] #360613
02/25/11 13:05
02/25/11 13:05
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Hm, sounds like you need a detail mapping shader.
There was something like that in the wiki if I remember right.

Re: shader for tiling texture ? [Re: the_clown] #360614
02/25/11 13:28
02/25/11 13:28
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
you mean this? http://www.opserver.de/wiki/index.php/Image:FFPDetailmappingProview.jpg

link seems dead

Re: shader for tiling texture ? [Re: darkinferno] #360616
02/25/11 13:43
02/25/11 13:43
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I will help you when I'm back home.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: shader for tiling texture ? [Re: Superku] #360622
02/25/11 15:07
02/25/11 15:07
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
ok thanks man

Re: shader for tiling texture ? [Re: darkinferno] #360646
02/25/11 18:54
02/25/11 18:54
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I don't know if that's what you want, but you could just declare
float4 vecSkill41;
in your shader, multiply "InTex" by skill41
OutTex = InTex*vecSkill41.x;
and, when you're scaling your entity, use its scale as skill41:
entity.skill41 = floatv(entity.scale_x);


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: shader for tiling texture ? [Re: Superku] #360649
02/25/11 19:40
02/25/11 19:40
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
lol i know nothing about shaders and would love to look into it but i need to release this demo to all you guys...... within 2 days [whistles]

Re: shader for tiling texture ? [Re: darkinferno] #360651
02/25/11 19:43
02/25/11 19:43
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Code:
float4x4 matWorldViewProj;
float4x4 matWorld;
float4 vecSunDir;
float4 vecSkill41;
texture entSkin1;

sampler ColorMapSampler = sampler_state
{ 
   Texture = <entSkin1>; 
}; 
    
void DiffuseVS( 
   in float4 InPos: POSITION, 
   in float3 InNormal: NORMAL, 
   in float2 InTex: TEXCOORD0, 
   out float4 OutPos: POSITION, 
   out float2 OutTex: TEXCOORD0, 
   out float3 OutNormal: TEXCOORD1)
   { 
 
   OutPos = mul(InPos, matWorldViewProj); 

   OutNormal = normalize(mul(InNormal, matWorld));

   OutTex = InTex*vecSkill41.x; 

} 
    
float4 DiffusePS( 
   in float2 InTex: TEXCOORD0, 
   in float3 InNormal: TEXCOORD1): COLOR 
{ 
 
   float4 Diffuse = saturate(dot(-vecSunDir, normalize(InNormal))); 
 
   float4 Color = tex2D(ColorMapSampler, InTex); 

   return (0.5+Diffuse)*Color; 
} 
 
technique DiffuseTechnique 
{ 
   pass P0 
   { 
      VertexShader = compile vs_2_0 DiffuseVS(); 
      PixelShader  = compile ps_2_0 DiffusePS(); 
   } 
}




"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: shader for tiling texture ? [Re: Superku] #360693
02/26/11 10:35
02/26/11 10:35
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Works very good, thank you - I can use this too.


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