3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1] 2

Author Topic: shader question/help  (Read 4166 times)

« on: August 01, 2010, 05:17:09 AM »
hi,

I could use a shader that show  textures on a mesh based on colors of the mesh texture, 3 colors... for example RGB, where R=texture 1, G=texture 2, B=texture 3, and blend textures so it looks nice (on the edges between).

did a quick search for this but couldnt find nothing alike. there's the magnificent terrain shader editor by Shadmar, but as far as I get it.. it works based on mesh height and not colors?? right?

there's something made like what Im asking?
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #1 on: August 01, 2010, 12:05:31 PM »
With blending or just pure colored RGB (textures) ? But what should it do, be smooth or bumpy and should  env (reflection) be supported, fog, directional light and/or 1-4 pointlights ?

I think I can include one in my system shader pak when I get back from small 5 day vacation.

You can divide shaders into:

1. Smooth shaders, supports fog all light modes and reflection (env mapping).
2. Bumpy shaders, supports fog all light modes (usually not reflection, can have but running out of texcoords for SM2 with 4 pointlights + directlight), Fernando works around this by disabling PL when bumpy+env are turned on. (I think!?)
3. Map shaders (lightmap,glowmap,colormap?) combined with 1 or 2, but not both in same shader.


« Last Edit: August 01, 2010, 12:08:17 PM by shadmar »
« Reply #2 on: August 01, 2010, 06:03:23 PM »
With blending or just pure colored RGB (textures) ?

not pure colored rgb (I think from what I understand on your response).

blending textures from one to another.

what I mean with RGB is the a texture the object have to define what texture goes in which color.

ex: I make a terrain and texture it with a texture with 3 different zones, in R, G and B colors. then the shader would interpret each color and, R would be textured as sand, G as grass and B as rock, and each of those would softly blend with each other.

what Im looking after is something like your terrain editor,but instead texture it by height, texture it by RGB.

since I want to use it for terrains, I think bumpy would be perfect.
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #3 on: August 02, 2010, 08:52:37 AM »
WOW :o  This Idea is great!!!
 
You could make very quick terrains or Terrain addons without UV-texturing, only paint with color and the shader will do the texturetiles and softblendings in game. No worry about the size of the SM. (and scriptless!)
 
But the user should have access to the three Texture files to exchange them.
 
Very useful shader, where can I donate?  :D
new forum search:
http://www.google.com/ site:www.3drad.com searchword  ( <-- copy )
3DRad is now in the same Brain-Area like my old C64 and Amiga Memories!
« Reply #4 on: August 02, 2010, 04:57:03 PM »
and the shader will do the texturetiles

I totally forgot that detail, thanks 3dSimulant!
the shader should have a value to modify where you can select "how much X" to tile the textures, or each texture.


But the user should have access to the three Texture files to exchange them.

Im not sure what you meant here...

the textures could be named textureR, textureG, textureB, and those are wich the shader user so then you just replace them with whatever you want: grass, rock, whatever.
was I any close?
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #5 on: August 03, 2010, 02:27:19 PM »
Yes, and to keep the things simple you can define the size of a Tile by resize the texture file.
For example: a 128pixel wide texture Tile is always 1meter at the Skinmesh, a 256pix tile will cover 2m of the SM. and so on...
 
This would increase the loading time dramatically because all the terrain Skinmeshes won't have textures, only 3 little shader tiles will be loaded once ;D !
 
I haven't got the time to prepare a graphic yet but I think this could be a little revolution in easy/fast-Terrainmaking (or is it only in my head, again :P )
 
 
new forum search:
http://www.google.com/ site:www.3drad.com searchword  ( <-- copy )
3DRad is now in the same Brain-Area like my old C64 and Amiga Memories!
« Reply #6 on: August 03, 2010, 07:35:30 PM »
Yes, and to keep the things simple you can define the size of a Tile by resize the texture file.
For example: a 128pixel wide texture Tile is always 1meter at the Skinmesh, a 256pix tile will cover 2m of the SM. and so on...

that "so on" could be colossal in a big terrain, also if you use the size of the file to tile (honestly, something completly unnecesary) you waste that valuable size that could be used for detail.

sorry, but tile must be software controlled, and by software controlled I mean a little value in a script. like:

int tileR=10; // that's it.

is not hard for the user to use it, and I know is not hard for the programer as the shadmar terrain editor feature such function with a slider.
and is not about making it harder or less simple either, is just how it works.

also you can always die tiling the texture if you want (not recomended at-all).

eeehhh... and what could be the amount colours limit? like... R G B I assume is ok, could be white and black included? to have more texture options.

also, (damn me) could the blending distance or area be a setup too?

I made a little graphic example this time about the initial idea.
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!

jestermon

« Reply #7 on: August 03, 2010, 09:14:58 PM »
.....also you can always die tiling the texture if you want (not recomended at-all).
Sounds like a dangerous job ... (*giggles* sorry loop, I had to point it out)
« Reply #8 on: August 04, 2010, 01:17:15 AM »
Great ideas!, tiling can be controlled by setting tilecount in the skinmesh dialog. UserTextureA/B/C.dds could be texture replacement for RGB read from model. We could also use one streched normalmap or one tiled.

Writing on my cell here at $6 per mb. This is expensive surfing.

psikotropico

« Reply #9 on: August 04, 2010, 05:54:38 AM »
Writing on my cell here at $6 per mb. This is expensive surfing.

addictions are expensive ;D
« Reply #10 on: August 04, 2010, 01:52:44 PM »
Yes Loop, I always try to define the features scriptless and easy to use for newbies so things can look strange for a real coder, but your way is much more flexibel and a little script don't hurt! :P
 
hm, black&white... maybe in the far future we can integrate real fur or grass for one color ;D ?!
 
 
@Shadmar: have a nice Holliday
new forum search:
http://www.google.com/ site:www.3drad.com searchword  ( <-- copy )
3DRad is now in the same Brain-Area like my old C64 and Amiga Memories!
« Reply #11 on: August 12, 2010, 06:37:50 PM »
This is what I think we can do.
We can do a shader that reads RGB map off a texture, then we use this to map the 3 terrain textures.

000_em        = environment, your RGB mask, a plain texture used for mapping the 3 others.
userTextureA = stone or something
userTextureB = sand or something
userTextureC = grass or something

This means blendings is done in a RGB texture mask instead of doing it in the shader, so use light brushes and blend. This would be a non bumpy shader, since we only have 5 texture slots alltogheter. 000_em 000_nm UserTextureA/B/C.

Sounds ok ?

« Last Edit: August 13, 2010, 01:32:33 AM by shadmar »
« Reply #12 on: August 12, 2010, 07:53:18 PM »
Quote
This means blendings is done in a RGB texture mask instead of doing it in the shader
how's that?
the RGB texture should include the blending, for example... from red to green? (fig1) and the shader would read red AND green and copy the blending in the textures?

Quote
This would be a non bumpy shader, since we only have 5 texture slots alltogheter. 000_em 000_nm UserTextureA/B/C.
000_nm isnt the bump texture?

also, Im feeling pretty dumb right here... but I dont understand how the 000_em which ..isnt the one used for reflexes? works as texture for the object.  ??? shouldnt be the object texture, like here? http://www.3drad.com/forum/index.php?topic=3873.0

???

other than that sounds great  :P
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #13 on: August 13, 2010, 01:37:07 AM »
how's that?
the RGB texture should include the blending, for example... from red to green? (fig1) and the shader would read red AND green and copy the blending in the textures?

Yes.

Quote
000_nm isnt the bump texture?
Yes but one bump for 3 different terrain textures?, can do but will it be useful ? Can use it but strecthed across?

Quote
also, Im feeling pretty dumb right here... but I dont understand how the 000_em which ..isnt the one used for reflexes? works as texture for the object.  ??? shouldnt be the object texture, like here? http://www.3drad.com/forum/index.php?topic=3873.0
???
You're not dumb, I have no idea I why wrote that..  ??? The object texture should do this yes :)
« Reply #14 on: August 13, 2010, 02:29:57 AM »
Ok here is what I got so far, tell me if this is what we're looking for.

Pic1 just shows the mesh texture.
Pic2 shows shader translating RGB to 3 other textures. In this case R=Stone, G=grass, B=sand

Any variations of white or black just becomes, light or shadowmap.
« Last Edit: August 13, 2010, 02:41:21 AM by shadmar »
Pages: [1] 2