Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Quad, EternallyCurious, 1 invisible), 726 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PRV over a shadowed terrain #449142
03/05/15 16:12
03/05/15 16:12
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
I realized the prv entity values are lost when putting a terrain as ground. It seems they are taking their values from the shadowmap of the block below the terrain that is full shadowed by the terrain itself.


Re: PRV over a shadowed terrain [Re: txesmi] #449159
03/06/15 09:38
03/06/15 09:38
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
A block is not shadowed by a terrain.

I rather think that the entities use the terrain's own shadow map.

Re: PRV over a shadowed terrain [Re: jcl] #449172
03/06/15 14:27
03/06/15 14:27
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
I can see a terrain casting shadows on blocks crazy Look at this:

Click to reveal..



I did some test and checked the terrain lightmap color by myself.

Click to reveal..

Code:
var my_floor_ambient ()
{
	if ( !me )
		return 0;
//	set ( my, LIGHT | UNLIT );
	vec_set ( &my->blue, COLOR_WHITE );

	VECTOR vPos;
	vec_set ( &vPos, &my->x );
	vPos.z -= 300 - my->min_z;
	you = NULL;
	var height = c_trace ( &my->x, &vPos, IGNORE_ME | IGNORE_MODELS | IGNORE_SPRITES | SCAN_TEXTURE );
	if ( HIT_TARGET )
	{
		if ( you ) // if you exits, is a terrain for sure
		{
			if ( you->lightmap )
			{
				BMAP *bmpSkin1 = ent_getskin ( you, 1 );
				var scale = bmap_width(you->lightmap) / bmap_width(bmpSkin1); //
				var format = bmap_lock ( you->lightmap, 0 );
				var cX = hit.u1 * scale;
				var cY = hit.v1 * scale;
				var pixel = pixel_for_bmap ( you->lightmap, cX, cY );
				COLOR col;
				pixel_to_vec ( &col, NULL, format, pixel );
				vec_set ( &my->blue, &col );
//				vec_set ( &col, COLOR_WHITE );
//				pixel = pixel_for_vec ( &col, 100, format );
//				pixel_to_bmap ( you->lightmap, cX, cY, pixel );
				bmap_unlock ( you->lightmap );
				set ( my, LIGHT | UNLIT );
			}
		}
		else // hit a block
		{
			reset ( my, LIGHT | UNLIT );
//			vec_set ( &my->blue, &hit.blue );
		}
	}
	return height;
}




and I use vecLight as ambient color into the shader
Code:
float4 color = float4(vecEmissive.xyz * vecColor.xyz, 0) + vecAmbient * vecLight;


Re: PRV over a shadowed terrain [Re: txesmi] #449252
03/10/15 14:10
03/10/15 14:10
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Ccan you check your "Terrain lighting" setting in the map compiler? It determines if the terrain is included in the lighting process or not.

Re: PRV over a shadowed terrain [Re: jcl] #449264
03/11/15 08:29
03/11/15 08:29
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
Yes. The terrain lighting is activated. I changed nothing in the compiler settings. There are no dynamic lights in the scene. Just a single static light with high resolution flags set. The terrain and blocks lighmaps are created by the compiler.

Re: PRV over a shadowed terrain [Re: txesmi] #449268
03/11/15 09:52
03/11/15 09:52
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Ok, can you then contact support and send them the project? We'll have to look into that.

Re: PRV over a shadowed terrain [Re: jcl] #449274
03/11/15 14:13
03/11/15 14:13
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
sent

Re: PRV over a shadowed terrain [Re: txesmi] #449358
03/16/15 15:51
03/16/15 15:51
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Thanks, we got it and will look into it.


Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1