Blend and light


(Qexpres) #1

Hi,
I’ve got two questions:

  1. How do I make a blend shader.
  2. How do I light up my models.

Blend:
I don’t know I’m using the right word for it, but I want a shaders which puts 2 shaders together for a smooth transition (like sand to rock texture).

I’ve allready got this:

textures/lost_phong/sand_to_rock
{
	q3map_shadeangle 90
	q3map_nonplanar
	qer_editorimage textures/lost_map/sand_to_rock.tga
	surfaceparm landmine
	surfaceparm gravelsteps

	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/lost_map/sand.tga
		blendFunc filter
	}
	{
		map textures/lost_map/rock.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
}

And this is the result:

I tried more things, but thisone looks the most…
How do I get half rock half sand instead of two mixed shaders?

Light:
I made a model which stands in a building’s shadow:

It is a pretty dark model, so I like to light it up a bit. Whatever I do with light entity’s, it doesn’t seem to work. I don’t want to make a gamemodel, because the model is in a position which is difficult to clip.
How do I light up my model?

Thanks in advance and sry for my possible, bad English. :slight_smile:


(The Wanderer) #2
  1. You can blend textures in two ways. With an alphamap or using alphamod brushes.
    If you’ve already build the terrain then the easiest way is with alphamod brushes. There are plenty of tutorials on this, just do a search(here’s one just in case).

2)is your model ase or md3? Are you using a shader for it?


(Qexpres) #3

I allready walked trough that tutorial… Seems I have to do my best even more.

And it is a .md3 file and I’m not using a shader for it.

Thx

Qexpres


(Detoeni) #4

You might not be using shaders, but that model is. The shader on that model only works on a “misc_gamemodel”

more info on blending: http://www.planetquake.com/simland/pages/articles/terrain1_1.htm


(Qexpres) #5

Sorry for my late reply.
I tried making blends, but I only get rock shaders instead of rock/sand shaders.
Do I HAVE to use those alphabrushes used in the tutorial?

This is my script:

textures/lost_map/sand_to_rock
{
	qer_editorimage textures/lost_map_terrain/sand_to_rock.tga
	q3map_nonplanar
        q3map_shadeangle 179
	surfaceparm landmine
	surfaceparm gravelsteps
	{
		map textures/lost_map_terrain/sand.tga
		rgbGen identity
	}
	{
		map textures/lost_map_terrain/rock.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaFunc GE128
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

I made 2 cars gamemodel with clips, but one of them doesnt show up in game. The clips are there, exept the model himself. I think “angles” is the problem, but I want a model which doesn’t show up black and which I still give the “angles”-key.

I would be grateful if someone could help me.

Thanks in advance once again.

Qexpres


(FireFly) #6

Yes, you have to use the alphabrushes to make it work.
You also need to compile your map with at least q3map 2.5.14

Here’s another small tutorial you might find usefull: http://www.priceofpeace.net/forums/index.php?act=ST&f=26&t=2079


(Qexpres) #7

Thank you very much.
I’ll have a look at it tomorrow. I thought it wasn’t neccesary to use those brushes, but probably it is.

I still don’t know how to solve the (game)model problem, but I’ll keep on trying.