0 registered members (),
984
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How to: tiles in 3dgs
[Re: Hummel]
#378770
07/26/11 12:43
07/26/11 12:43
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
NOOO, Shaders are bad!!!111111111 They don´t work on hardware older than 10 years!!!!!!!!!!!! Oh and shadermodel 3 is the devil himself as it won´t work on hardware older than 7 years!!!1111111111 Did I mention that my 2 years old iPhone can´t render anything without shaders?
|
|
|
Re: How to: tiles in 3dgs
[Re: Joozey]
#378806
07/26/11 17:29
07/26/11 17:29
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
That is what I had in mind Except I don't think panels can have shaders. I was thinking a quad, or doing it all in a pp-shader that takes into account level offset. Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: How to: tiles in 3dgs
[Re: JibbSmart]
#378831
07/26/11 20:15
07/26/11 20:15
|
Joined: Jan 2003
Posts: 4,615 Cambridge
Joey
Expert
|
Expert
Joined: Jan 2003
Posts: 4,615
Cambridge
|
not exactly what I meant, but should work just as well. Do a point-sampled texture lookup for your base texture, and then, depending on the color of the pixel, fill the texel with a detailed tile. In principle that's something like
unsigned int4 base = tex2D(baseSampler, texCoord.xy);
switch (base.x) {
case 1:
float3 out = tex2D(tile1Sampler, fmod(texCoord.xy*TILE_SIZE, TILE_SIZE);
break;
...
}
Joey
|
|
|
Re: How to: tiles in 3dgs
[Re: Joey]
#378832
07/26/11 20:21
07/26/11 20:21
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
If the tiled textures are going to be quite small (like shown), I would pack them into one texture, and use the base texture as an offset within the tiled texture.
I think that'd be more efficient.
Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: How to: tiles in 3dgs
[Re: Hummel]
#378846
07/26/11 23:07
07/26/11 23:07
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
OP
Expert
|
OP
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
What about just scaling the base color bitmap on screen, and apply a detail-bitmap on it with the shader? Just a black tga with transparent parts that form the details on the (plain colored) block. Currently playing too much with the noise-landscape generator . Edit: I went for the cheap approach: put up a window element in a panel, apply one detail-tile tga bitmap to it, and resize the window to full screen. The detailed tile is automatically tiled over the screen. Insta-tiles. This also makes cubes from the sky though, not sure if I like that. Will try the shader approach too soon. Thanks for the shader snippet and all suggestions .
Last edited by Joozey; 07/27/11 06:55.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
|