Gamestudio Links
Zorro Links
Newest Posts
Log file - overwrite and/or append
by DdlV
11 minutes 52 seconds ago
by MatPed
12 minutes 38 seconds ago
save you.x in *.txt with ent_next doesen't work :(
by CocaCola
Today at 14:33
historical data from alphavantage
Today at 14:10
Multible Windows / Screens
by Superku
Today at 10:41
Connors RSI implementation
by Materz
Yesterday at 19:51
Weird sscanf() errors
by Zheka
Yesterday at 16:23
AUM Magazine
Latest Screens
Forgotten Tales - Demo version
Triton Wing now available on Steam
AckCon'17: Lotter vs The World
Who's Online
19 registered (MatPed, easyX, mig, jfrusty, Kartoffel, Iglarion, mk_1, Hredot, kujo, 3 invisible), 444 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
NicolaB, eiking777, maurice1973, IMMO_VIE, Enric
17918 Registered Users
Topic Options
Rate This Topic
#337940 - 08/14/10 20:02 ENABLE_TREE not working with view.material ?
BoH_Havoc Offline

Registered: 06/02/04
Posts: 655
Loc: to your left
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:
#include <litec.h>
#include <acknex.h>
#include <default.c>

void v_camera()
		my.pan -= mickey.x;
		my.tilt -= mickey.y;

var mtl_dontRender_event()

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

void main()
	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);
	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

#338219 - 08/16/10 19:12 Re: ENABLE_TREE not working with view.material ? [Re: BoH_Havoc]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26261
Loc: 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.

#338235 - 08/16/10 19:55 Re: ENABLE_TREE not working with view.material ? [Re: jcl]
BoH_Havoc Offline

Registered: 06/02/04
Posts: 655
Loc: 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

#463517 - 12/09/16 18:15 Re: ENABLE_TREE not working with view.material ? [Re: jcl]
Superku Online
Senior Expert

Registered: 09/13/03
Posts: 6663
Loc: 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

Superku The Game

Severely outdated footage:


Moderator:  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs

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