Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Quad, VoroneTZ, 1 invisible), 623 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ENABLE_TREE not working with view.material ? #337940
08/14/10 18:02
08/14/10 18:02
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline OP
User
BoH_Havoc  Offline OP
User

Joined: Jun 2004
Posts: 655
to your left
Hi,
i'm currently in the process of boosting my shadowmapping, refraction and reflection shaders and tried to clip away unneeded objects by using ENABLE_TREE and returning 1 in the material event.

So far, i couldn't get ENABLE_TREE to work with view.materials.

ENABLE_RENDER works fine, but in an older post you mentioned that using ENABLE_RENDER only gives a 75% performance boost, while ENABLE_TREE givs almost 100% (like NOFLAG1 does). So i'd rather use ENABLE_TREE instead of ENABLE_RENDER.
I also don't want to use NOFLAG1, so flag1 can be used for other things.

Am i trying to achieve something stupid here? Is ENABLE_TREE actually not working with view.materials due to a technical restriction?
When assigning the material directly to an entity, it's working just fine.

Here's my code:
Code:
#include <litec.h>
#include <acknex.h>
#include <default.c>

void v_camera()
{
	set(my,INVISIBLE);
	set(my,PASSABLE);
	while(1)
	{
		c_move(my,vector(key_force.y*50*time_step,-key_force.x*50*time_step,0),nullvector,IGNORE_PASSABLE);
		my.pan -= mickey.x;
		my.tilt -= mickey.y;
		
		vec_set(camera.x,my.x);
		vec_set(camera.pan,my.pan);
	
		
		wait(1);
	}
}


var mtl_dontRender_event()
{
	return(1);
}

MATERIAL* mtl_dontRender =
{
	flags = ENABLE_TREE;
	event = mtl_dontRender_event;
}

void main()
{
	level_load("");
	wait(3);
	
	you = ent_create(NULL,vector(0,310,746), v_camera);
	you.tilt = -90;
	
	you = ent_create(CUBE_MDL, vector(0,0,0), NULL);
	you = ent_create(CUBE_MDL, vector(0,100,0), NULL);
	you = ent_create(CUBE_MDL, vector(0,200,0), NULL);
	
	//this entity will not be rendered, works nicely
	you = ent_create(CUBE_MDL, vector(0,300,0), NULL);
	you.material = mtl_dontRender;
	
	you = ent_create(CUBE_MDL, vector(0,400,0), NULL);
	you = ent_create(CUBE_MDL, vector(0,500,0), NULL);
	you = ent_create(CUBE_MDL, vector(0,600,0), NULL);
	
	
	//create a second view which uses the dontRender material
	//this doesn't work
	VIEW* secondView;
	secondView = view_create(2);
	set(secondView,SHOW);
	set(secondView,NOCULL);
	secondView.size_x = screen_size.x/2;
	secondView.size_y = screen_size.y/2;
	secondView.material = mtl_dontRender;
	secondView.x = 0;
	secondView.y = 300;
	secondView.z = 760;
	secondView.tilt = -90;
}



I'm currently using NOFLAG1 as a workaround and it gives a nice boost for shadows. It would be nice if i could "port" my code to ENABLE_TREE laugh

I'm using the latest A7 pro (also tried it with the A8 trial)

Thanks in advance! And sorry if this isn't a bug wink


Shade-C EVO Lite-C Shader Framework
Re: ENABLE_TREE not working with view.material ? [Re: BoH_Havoc] #338219
08/16/10 17:12
08/16/10 17:12
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes, that's correct. ENABLE_TREE is for entity materials only, not for view materials. I'll check if it can be implemented also for view materials - otherwise we'll mention this in the manual.

Re: ENABLE_TREE not working with view.material ? [Re: jcl] #338235
08/16/10 17:55
08/16/10 17:55
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline OP
User
BoH_Havoc  Offline OP
User

Joined: Jun 2004
Posts: 655
to your left
Good to know laugh

I'll cross my fingers then that it'll work with view materials in the future wink


Shade-C EVO Lite-C Shader Framework
Re: ENABLE_TREE not working with view.material ? [Re: jcl] #463517
12/09/16 17:15
12/09/16 17:15
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Apparently this wasn't possible to implement sadly, yet it's not mentioned in the manual either.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Spirit 

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