DarkPlaces - Model Shadows.

Discuss the creation of various model formats for Quake engines, and related matters to modeling.
Post Reply
Qrv
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

DarkPlaces - Model Shadows.

Post by Qrv »

Hello,

Here I have a few tree models, q3 format. As you can see, they load in-game fine, however, two main problems.

Image

Image

First thing to notice, the leaves are pretty fullbright. Here's the shader currently being played with for the leaves:

Code: Select all

models/mapobjects/oak/oakblaetter
{
	//cull none
	cull disable
	nopicmip
	dpshadow
	{
		map models/mapobjects/oak/oakblaetter.tga
		alphaFunc GE128
		//depthWrite
		//rgbGen vertex
		rgbGen lightDiffuse
	}
}
The comment out parts are from the original shader, as I've adjusted it some to how I understand the shader should be, for non-full bright leaves.

Also notice, that "dpshadow" is enabled in the shader, which leads me to my next issue.

In the second screenshot, you'l see a lack of shadows for leaves.
Although the second screenshot doesnt show it, with dpshadow enabled inside the shader, the leaves polygon casts shadows, ie, you get a square shaped shadow, not leaf shapes.

Can DarkPlaces not cast RT Shadows using the alpha layer of textures as a mask? And also, is there anyway to sort out the lighting for the leaves, so their not practically fullbright?




( DarkPlaces needs more, correct and up-to-date documentation. -.- )
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: DarkPlaces - Model Shadows.

Post by Nahuel »

I do not understand many about shaders and darkplaces suppport. But for a texture with channel alpha this shader will work correctly (no fullbright) . Maybe this shader has innecesary lines :oops:, I do not know how works the "dpshadow".

Code: Select all

models/mapobjects/oak/oakblaetter
{	

	{
	map models/mapobjects/oak/oakblaetter
		blendFunc GL_ONE GL_ZERO
		alphaFunc GE128
		depthWrite
		rgbGen identity
	}

	{
      	map $lightmap
      	rgbGen identity
      	blendFunc GL_DST_COLOR GL_ZERO
      	depthFunc equal
	}

}
I do not know if darkplaces can cast shadows with a poligon with a texture with chanel alpha, or some transparency. I didn´t get it at the time :)
hi, I am nahuel, I love quake and qc.
Qrv
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

Re: DarkPlaces - Model Shadows.

Post by Qrv »

Hmm, thanks for that Nahuel, it's still not quite right. I'm starting to wonder if its just DarkPlaces and not the shader, prehaps my expectations for DP engine is a bit beyond what it can actually do, I dunno.

Image

Shader used:

Code: Select all

models/mapobjects/oak/oakblaetter
{
	cull none
	//cull disable
	//nopicmip
	//dpmeshcollisions
	//dpshadow
	{
		map models/mapobjects/oak/oakblaetter.tga
		blendFunc GL_ONE GL_ZERO
		alphaFunc GE128
		depthWrite
		//rgbGen vertex
		//rgbGen lightDiffuse
		rgbGen identity
	}
	
	{
		map $lightmap
		rgbGen identity
		blendfunc GL_DST_COLOR GL_ZERO
		depthFunc equal
	}
}

As for "dpshadow" in shaders, Nahuel, it's supposed to allow 'stuff' to cast shadows. One usage for it, is to allow invisible brushes to cast shadows.
Taken from the DP Wiki:

Code: Select all

textures/common/shadowmesh
{
 dpshadow
}
Such a shader should be invisible in-game, but cast shadows. I suppose it's there for strange circumstances, like to recreate the "Q" logo on the ground, in one of iD's maps, but the sky doesnt show the Q in brushes. I'm sure it can be pretty usefull with some imaginative usage. Theres also "dpnoshadow" you can stick in your shaders, to do the opposite. Cast no shadows.
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Sami
Posts: 5
Joined: Sat May 13, 2006 4:09 pm

Re: DarkPlaces - Model Shadows.

Post by Sami »

Take a look at the alphashadow shader keyword - it should do what you want (i.e. use the alpha channel when working out shadows rather than the opaque polygons).
Qrv
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

Re: DarkPlaces - Model Shadows.

Post by Qrv »

I thought alphashadow only applied when using the standard q3bsp lightmapping?
If i recall correct, thats exactly what it's for.

Unless your telling me DP has something like dpalphashadow? I've never heard of such a thing, but alot of DP's stuff seems undocumented so, it might exist.

But the lighting im using here is the Real Time lighting within DarkPlaces, to get these shadows.
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Post Reply