LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   JA Mapping (http://www.lucasforums.com/forumdisplay.php?f=540)
-   -   Terrain (http://www.lucasforums.com/showthread.php?t=130400)

lauser 06-22-2004 05:32 PM

Terrain
 
Terrain texture blending. What are the specs for that?

textures/endor/groundd
{
qer_editorimage textures/endor/groundd
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
q3map_material ShortGrass
cull twosided
{
map textures/endor/groundd
rgbGen vertex
alphaGen vertex
tcmod scale 0.167 0.167
}
}

Will this work? I made my own custom brushwork terrain and I want to know if this will blend the verts.

GothiX 06-22-2004 05:51 PM

http://www.splashdamage.com/index.ph...ewtopic&t=8276

lauser 06-23-2004 04:33 AM

Wholly MEATY shaders BATMAN! I have a lot to learn... :D

Thanks Gothix but, this is going to take some time and trial and error.

lauser 06-23-2004 02:46 PM

Apparently there was some confusion about the alpha channels. As to whether you need them or not. But I think it makes sense to have them. So I'm going to try both jpgs and PNGs. Now they use PNGs that hold Alphas for JA. Maybe I should stick with TGA. I'm paranoid about shaders working properly.

The LINK Gothix gave me has other links in it to help out with terrain blending. Apparently they are trying to throw together NOOB tutorials for terrain blending. These methods are for custom terrains without using the old method of bitmaps and PCX files as far as I can tell. :)

Here are the files you need for terrain blending:

alphascale

Just put them in the appropriate folders.


GOTHIX, I'm not entirely sure but I think Q3map_surfaceModel is enabled still. It's just no one is using it that I'm aware of. So I emailed Ydnar just incase regarding that feature. I would like to experiment with this feature if I can get the shader correctly laid out.

q3map_surfaceModel modelpath density odds minscale maxscale minangle maxangle oriented

A surface with q3map_surfaceModel in its shader will randomly place a specified model across it's face. This is designed to place grass or tree models over terrain.
modelpath : The path to the model file (any supported format).

density : The density of the models, in game units.

odds : The odds of the model appearing (normalized?).

minscale : The minimum scale of the model from its original size of 1.0.

maxscale : The maximum scale of the model from its original size of 1.0.

minangle : The model's minimum angle of rotation.

maxangle : The model's maximum angle of rotation.

oriented : This is a flag, either 0 or 1, and sets whether the model gets fitted to the orientation of the surface.


Is this what we are looking for:

textures/endor/groundd
{
qer_editorimage textures/endor/groundd
q3map_surfaceModel models/map_objects/endor/tree 800 2 1.4 2.6 0 270 1
surfaceparm nolightmap
q3map_novertexshadows

{
map textures/endor/groundd
}
}

Anyone? Does this look like it will work? I guess I can do a TEST map and see if it works.

lauser 06-23-2004 10:17 PM

I just got a reply back from Ydnar. He says the function works. WOOT! This should make mapping much easier if let's say you want a scene with lots of detail on the terrain. He did not say anything about performance loss. He did say that he only recommends using small items as the CLIP feature for this is buggy.

shukrallah 06-23-2004 10:44 PM

O_O


Man I wish I understood shaders. Im going to stick with easy gen...

lauser 06-24-2004 02:30 AM

It's like anything else Luke. Just takes practice and a little patience. I have a hard time with shaders too. But if you read the shader manual it helps. Have a look at other shaders and see what they do also helps.

GothiX 06-24-2004 04:28 AM

Q3map_surfaceModel has never been taken out, actually. It's a lovely feature, but you'd better have some decent models to go with it. :)

WadeV1589 06-24-2004 05:03 AM

It's one of those I've used and absolutely love it, it makes things like random rocks in a desert an absolute breeze.

lauser 06-24-2004 06:25 AM

Okay cool. There was a thread a ways back that said it was not enabled..anyhow.....

How much does it affect performance? Anyone know?

shukrallah 06-24-2004 09:32 AM

Quote:


Here are the files you need for terrain blending:

alphascale

Just put them in the appropriate folders.


Ok, I DLed it, and I assume the shader goes in the shaders folder, and not the script folder? Also, Ive added it to my shaderlist.txt file, and put the textures in textures/common/alpha.... etc. This should work right?

I think I get it... :)

Jedi_Vogel 06-24-2004 10:03 AM

Quote:

Originally posted by lukeskywalker1
I assume the shader goes in the shaders folder, and not the script folder?
Yeah, SOME things in mapping are easy, but I think I can count them on one hand :lol:

shukrallah 06-24-2004 09:38 PM

Aye, but texture blending is not on that one hand. Im going to keep trying, and if I cant get it, ill post back here.

EDIT: OK

I made 2 shaders for 2 textures. Here are the textures:

textures/compress/rock.jpg
textures/compressgrass1.jpg

Here are the 2 shaders:

shaders/rock_blend
shaders/ground1

Rock_Blend.shader

Code:

textures/compress/rock_blend
{
  qer_editorimage textures/compress/rock
   
  q3map_forceMeta
      q3map_nonplanar
      q3map_shadeAngle 179
  surfaceparm nolightmap
  {
      map textures/compress/rock
          rgbGen identity
  }
  {
      map textures/compress/rock
      blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA           
            rgbGen identity
            alphaGen vertex
      }
      {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
            rgbGen identity
      }
}

grass1.shader
Code:

textures/compress/grass1
{
  qer_editorimage textures/compress/ground

      q3map_forceMeta
      q3map_nonplanar
      q3map_shadeAngle 179
  surfaceparm nolightmap
  {
      map textures/compress/ground
          rgbGen identity
  }   
      {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
            rgbGen identity
      }
}

In radiant I took rock.jpg and put it on a square in the middle of a room. All around the square was covered with grass1.jpg. In radiant they had the white thing around it, so I know it was a shader. I put the alpha 0 (or something) in the rock.jpg square. I made those two into a func_group, and all of it was detail.


http://home.ripway.com/2003-11/40395/radiant_blend.JPG

:-/ Anyways, looks like a normal map inside JA.

lauser 06-25-2004 12:56 AM

So Luke, the blending did NOT occur ingame? You just had normal textures without any blending?

Okay try making the ALPHA brush much smaller. You don't need it that high, just for neatness purposes. And make sure that alpha brush is level at the bottom with all the other brushes. Try extending the Alpha beyond the vertices of the large brush encompassing the verts of the smaller brushes and post back here.

Did you use Q3map2 2.5.14? You need the latest compiler to make it work. Actually 2.5.15 is the latest I believe but I use the latter....works just fine.

Also your shader needs work. Look at the examples in the tutorials. Your textures need to be TGAs with a white alpha channel also. You need AlphaBlend to blend the layers so that part of your texture will actually be see through. Understand? If you can see through a portion of the texture that is the illusion of blending.

shukrallah 06-25-2004 09:35 AM

Alright, I see, Ill give it another shot.

GothiX 06-25-2004 11:44 AM

Eh, Lauser, you're wrong. Alphamod blending is based on vertexpoints, so dropping the alpha_0 brush in the middle of a plane isn't going to work. Also, if you'd put it at all 4 points, it wouldnt work, since you're then marking the whole surface as a 0% fade. Cut the brush up into four brushes using an X-shape, and use the alpha_0 brush in the middle, surrounding the center vertex.

lauser 06-25-2004 10:43 PM

Hmm..that makes more sense now Gothix. If I have a hill with 3 different textures at different heights, I'll assume I just have to manipulate multiple brushes to get the fade effect. Because I never got the whole trisouping thing. I'll assume trisouping is making a brush into 4 triangles...or...what I do is just vertex edit and then I have 2 different triangular surfaces but one brush. I will assume this will still work. If not then I have to cut up the brushes where I want the terrain to blend.

shukrallah 06-25-2004 10:51 PM

hmmm, ok... 4 brushes, yeah, in the tutorial that dude had 4 brushes for his blend area.

About the channel thing. You mean that my texture will need something like a layer on it.. ? You know like with photoshop (I use gimp) to add transperency, and other layers?

Or are you talking about the actual alpha shader (that 0%) thing?

lauser 06-26-2004 01:35 AM

I'm talking about adding an alpha channel and saving it as a TGA. Since JK based games only support TGAs and PNGs.

shukrallah 06-26-2004 10:11 AM

Ok. Hmmm... so does anyone know if photoshop elements does this? Or how to do it with Gimp. If not, dont worry about it. I tried it, and the whole TGA turned black. :-/

GothiX 06-27-2004 05:55 AM

PS can do it, add a new channel in the channels tab (bottom-right), and make it completely white, save it as a 32-bit TGA. (FYI: Each channel uses 8 bits, and you're using four channels: R, G, B, and an alpha channel. A 24-bit TGA will only use RGB channels)

shukrallah 06-27-2004 07:28 PM

hmmm... ill install the demo I have of it (i got it on a cd, that came with a book)

lauser 06-28-2004 01:34 AM

Sorry Luke. I forgot to mention Paint Shop Pro has this feature enabled in all versions.

shukrallah 06-28-2004 04:05 PM

should the layer window look like this:

http://home.ripway.com/2003-11/40395/layer.jpg

The background is a ground.jpg and i clicked to add a new layer. But the thing is, I cant get the new layer on the screen to color it white.

GothiX 06-28-2004 04:09 PM

Looks like you're using an old version of PS - my version has a "channels" tab there..

shukrallah 06-28-2004 04:30 PM

well, im using photo shop elements...

ill try paint shop pro

mslaf 06-28-2004 05:08 PM

Maybe you should try this one:

http://www.mslaf.com/tutorials/ps1.jpeg

Codja X 06-29-2004 06:19 AM

I've read somewhere that the tga exporter in Photoshop 7 is corrupt and doesn't save the alpha channel properly.

Try updating that plugin and see if makes a difference.

mslaf 06-29-2004 10:48 AM

Quote:

Originally posted by Codja X
I've read somewhere that the tga exporter in Photoshop 7 is corrupt and doesn't save the alpha channel properly.

Try updating that plugin and see if makes a difference.

The TGA plugin was buggy in PS 7.0 and PS 7.0.1 - alpha channel was not exported.

Adobe has fixed this problem over a year ago.

http://www.lucasforums.com/showthrea...hreadid=128473

Codja X 06-29-2004 11:12 AM

Quote:

Originally posted by mslaf
http://www.lucasforums.com/showthrea...hreadid=128473
That's probably where I read it. Still, it's worth look if all else fails.

shukrallah 06-29-2004 11:33 AM

Im not using photo shop 7, im using photo shop elements 2, its like a cheaper photoshop i guess.

Maybe ill use png? In the shader, instead of .tga at the end, i would put .png right.. sort of common sense i guess.

Codja X 06-29-2004 12:28 PM

You can get the latest version of the targa (TGA) exporter here:

http://www.adobe.com/support/downloa...jsp?ftpID=1544

It should work with Photo Elements 2 as well.

It shouldn't matter about the extension too much. As long as the file is saved as myimage.png and that is where you point it, then yeah, should be okay

lauser 07-01-2004 05:17 PM

Here are some RADIANT shots of ENDOR terrain. Some 450 custom trisouped brushes with rgoers alpha 0 brushes.

http://www.unitedjedi.com/radiantmin....php?p=507#507


All times are GMT -4. The time now is 05:24 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.