Gamestudio Links
Zorro Links
Newest Posts
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
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 482 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 5 1 2 3 4 5
Re: Shade-C all in one FX [Re: sivan] #440120
04/18/14 11:51
04/18/14 11:51
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Yes, like Sivan mentioned the fx files are limited like WAD and MDL models files to 15 characters.

Originally Posted By: DLively
...Yes when I enable sc_setup and create one light the fps drops by 1/3

Hmm strange, i got stable 60fps eg. 144 dynamic lights, like code below.



Code:
#include <default.c>

#define PRAGMA_PATH "shadec"
#include "shade-c.h"

#include "common.h"

ENTITY* skycube =
{
	type = "plain_abraham+6.tga";
	flags2 = SKY | CUBE | SHOW;
	red = 130;
	green = 130;
	blue = 130;
}

VECTOR vSpeed, vAngularSpeed, vForce, vMove;
ENTITY* spotlight[144];

void main()
{	
	fps_max = 60;
	shadow_stencil = -1;
	video_set(800, 600, 0, 2);
	level_load("05.wmb");
	wait(3);
	vec_set(sun_color, vector(0,0,0)); 
	vec_set(ambient_color, vector(0,0,0));
	
	vec_set(camera.x,vector(840,-870,700));
	vec_set(camera.pan,vector(135,-40,0));
	camera.arc = 90;
	
	sc_sky(skycube);
	sc_screen_default = sc_screen_create(camera);
	sc_setup(sc_screen_default);
	
	int i,j,k=0;
	var dist_x = -646, dist_y = 520;
	
	random_seed(0);
	
	for (i=0;i<12;i++){
		for (j=0;j<12;j++){
			spotlight[k] = sc_light_create(vector(dist_x,dist_y,200), 500, vector(random(255),random(255),random(255)), SC_LIGHT_SPOT | SC_LIGHT_SPECULAR, vector(0,-90,0), 40);
			k++; 
			dist_x += 114;
		}
		dist_x = -646;
		dist_y -= 114;
	}
	
	for (k=0;k<143;k++)
	sc_light_update(spotlight[k]);
	
	def_debug();
	
	draw_textmode("Arial",3,16,100);
	var speed = 20;
	
	while(1)
	{
		draw_text("click and hold [RMB] and use [QWEASD] keys to move the camera",2,115,COLOR_GREEN);
		
		if(mouse_right) // Move the camera if the right mouse button was pressed
		{
			vForce.x = -speed *(key_force.x + mouse_force.x); // pan angle
			vForce.y =  speed *(key_force.y + mouse_force.y);	// tilt angle
			vForce.z = 0;	// roll angle
			vec_accelerate(vMove,vAngularSpeed,vForce,0.8);
			vec_add(camera.pan,vMove);
			vForce.x = speed * (key_w - key_s);	// forward
			vForce.y = speed * (key_a - key_d);	// sideward
			vForce.z = speed * (key_q - key_e);	// upward
			vec_accelerate(vMove,vSpeed,vForce,0.5);
			vec_rotate(vMove,camera.pan);
			vec_add(camera.x,vMove);
		}
		wait(1);
	}
}



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: Shade-C all in one FX [Re: rojart] #440125
04/18/14 14:46
04/18/14 14:46
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Okay, thats good to know laugh

If I reduce my screen size to 800x600 then my fps stays around 60. Otherwise I get an fps of 31 or so at 1280x720.

Since the upgrade to my project, I'll have to do some level optimizing - my level dimensions are around 6000x4000 - that being my biggest level conisting of several rooms and models adding to 306 entities (using LOD stages) -> My Nexus is 339573 and that has to be bad.. since I read that 500MB is commercial size.. mem is 391, geo and shad 0 -> ents 274 and 1578 Free. This level is only 25% done (If that).. Face Palm..

Last edited by DLively; 04/18/14 14:46.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Shade-C all in one FX [Re: DLively] #440145
04/19/14 00:19
04/19/14 00:19
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Okay disregard the last post - I am going to redo that level and just optimize the hell out of it...

How do I use particles with shadec?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Shade-C all in one FX [Re: DLively] #440146
04/19/14 01:38
04/19/14 01:38
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Figured it out laugh

Thanks For this fine Whole lot of Awesome laugh


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Shade-C all in one FX [Re: DLively] #440147
04/19/14 01:57
04/19/14 01:57
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
I wanted to note that my model works when:

entskin1 = diffuse
entskin2 = specular (G,B,A are black)
entskin3 = NormalMap (Alpah is Black)


---------------------

Am I doing something wrong? Cause I tried to follow the instructions that were given to Random in a seperate post and although he was successful in his results after following the instructions, I was not.

I would like to also ask how to add Shadows now laugh


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Shade-C all in one FX [Re: DLively] #440156
04/19/14 09:37
04/19/14 09:37
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: DLively
Okay, thats good to know laugh...If I reduce my screen size to 800x600 then my fps stays around 60. Otherwise I get an fps of 31 or so at 1280x720...

Ok, checked in fullscreen resolution by full HD (1920x1080) for you and i get ~31fps > ~60fps depending of the distance to the ground.
You can test my exe in relation of performance also.

My Computer Specs:
OS: Windows 8.1 Pro 64-bit
CPU: i7-4770 @ 3.40GHz
GPU: GeForce GTX 760 @ 2048MB
RAM: 16GB
PRG: A8 Pro 8.45.4


Originally Posted By: DLively
Since the upgrade to my project, I'll have to do some level optimizing - my level dimensions are around 6000x4000 - that being my biggest level conisting of several rooms and models adding to 306 entities (using LOD stages)...

You use the Automated Managed Level of Detail from MED for your models (MED > Object > Manage Level of Detail), right?

Originally Posted By: DLively
...How do I use particles with shadec?

sc_screen_default.settings.forward.enabled = 1; //enable if you need particles or custom materials which can't be rendered in the deferred pipeline
Was this?

Originally Posted By: DLively
I wanted to note that my model works when:
entskin1 = diffuse
entskin2 = specular (G,B,A are black)
entskin3 = NormalMap (Alpah is Black)
---------------------
Am I doing something wrong?

It seems to me, that you've another chronology of skin numbers.
Your Specular have skin2.x and Normalmap skin3.xyz
If you need the same like me, then change to:
Code:
//assign skins
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_ALPHA (skin1.w) //alpha
#define SKIN_NORMAL (skin2.xyz) //normalmap
#define SKIN_GLOSS (skin2.w) //glossmap



Originally Posted By: DLively
...I would like to also ask how to add Shadows now laugh

It's very simple, add this flag SC_LIGHT_SHADOW to the light function:

Code:
spotlight[k] = sc_light_create(vector(dist_x,dist_y,200), 500, vector(random(255),random(255),random(255)), SC_LIGHT_SPOT | SC_LIGHT_SPECULAR | SC_LIGHT_SHADOW, vector(0,-90,0), 40);



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: Shade-C all in one FX [Re: rojart] #440165
04/19/14 13:30
04/19/14 13:30
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Mine looks like this? smirk

I had added :
ENTITY* light_child = sc_light_create(vector(0,0,0), sc_lightrange, vector(255,140,80), SC_LIGHT_SHADOW);

and get no shadows -> about to try your suggested methods -> You rock Rojart laugh

...

Okay shaodws are working however to make my work a little less guessy - Could I ask what these peramteres are?

spotlight[k] = sc_light_create(vector(dist_x,dist_y,200), LIGHTRANGE*, COLOR RGB*, SC_LIGHT_SPOT | SC_LIGHT_SPECULAR | SC_LIGHT_SHADOW, vector(0,-90,0), 40);


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Shade-C all in one FX [Re: DLively] #440173
04/19/14 16:16
04/19/14 16:16
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
I found it in the commons laugh But I still dont understand everything laugh

Last edited by DLively; 04/19/14 16:17.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Shade-C all in one FX [Re: DLively] #440175
04/19/14 17:48
04/19/14 17:48
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
1280X720 zoomed out I get 10Fps with your example Rojart laugh

The computer I am using only has 4GB of Ram and 512MB Card smirk My other machine has 8GB or Ram and 1024MB GPU.

Is there a way to acchieve these graphics without the huge loss of fps? I've played games on this computer that would require so much more reources than I use - and I my fps doesn't drop - It obviously must be me.

Last edited by DLively; 04/19/14 17:50.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Shade-C all in one FX [Re: DLively] #440176
04/19/14 18:28
04/19/14 18:28
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Here's a note:

Code:
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_ALPHA (skin1.w) //alpha
#define SKIN_NORMAL (skin3.xyz) //normalmap
#define SKIN_GLOSS (skin3.w) //glossmap



which is skin 1 and 3 smirk

Click to reveal..

//------------------------------------------------------------------------------
//----- USER INPUT -------------------------------------------------------------
//------------------------------------------------------------------------------

//assign skins
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_ALPHA (skin1.w) //alpha
#define SKIN_NORMAL (skin3.xyz) //normalmap
#define SKIN_GLOSS (skin3.w) //glossmap
//#define SKIN_EMISSIVEMASK (skin3.y) //emissive mask
//#define SKIN_COLOR (skin3.w) //(team)color mask
//#define SKIN_EMVMAPMASK (skin3.x) //environment mapping mask
//#define SKIN_VELVETYMASK (skin3.z) //velvety lighting mask
//...

//#define MTL_SKIN1 //skin1 is a mtlSkin and not an entSkin?
//#define MTL_SKIN2 //skin2 is a mtlSkin and not an entSkin?
//#define MTL_SKIN3 //skin3 is a mtlSkin and not an entSkin?
//#define MTL_SKIN4 //skin4 is a mtlSkin and not an entSkin?

#define NORMALMAPPING //do normalmapping?

#define GLOSSMAP //entity has glossmap?
#define GLOSSSTRENGTH 0 //glossmap channel will be set to this value if GLOSSMAP is not defined

//#define EMISSIVEMASK //use emissive mask? (formula: emissive_color = SKIN_EMISSIVEMASK * SKIN_ALBEDO)
//#define EMISSIVE_A7 // (optional EMISSIVEMASK addon) use emissive_red/green/blue for as emissive color? (formula: emissive_color = SKIN_EMISSIVEMASK * vecEmissive)
//#define EMISSIVE_SHADEC // (optional EMISSIVEMASK addon) OR use SC_OBJECT_EMISSIVE as emissive color? (formula: emissive_color = SKIN_EMISSIVEMASK * SC_OBJECT_EMISSIVE)

//#define OBJECTCOLOR_A7 // use diffuse_red/green/blue as (team)color using the colormask?
//#define OBJECTCOLOR_SHADEC // OR use SC_OBJECT_COLOR as (team)color using the colormask?

//#define ALPHACLIP //do alphatesting/alphacutout?

//#define USE_VEC_DIFFUSE //use diffuse_red/green/blue? (note: don't use with OBJECTCOLOR_A7 at the same time)

//#define ZPREPASS //do an early zbuffer prepass? Only makes sense for heavy ALU

//------------------------------------------------------------------------------
// ! END OF USER INPUT !
//------------------------------------------------------------------------------

#include <scHeaderObject>
// <-
// insert custom code here
// ->
#include <scObject>


I changed that and it works now laugh Starting to figure shadows out too laugh

Thank you for your patience!!


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Page 2 of 5 1 2 3 4 5

Moderated by  Blink, Hummel, Superku 

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