Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 968 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 45 of 61 1 2 43 44 45 46 47 60 61
Re: Shade-C v0.91 BETA S1 RELEASED [Re: Ch40zzC0d3r] #408087
09/25/12 01:32
09/25/12 01:32
Joined: Apr 2005
Posts: 795
U.S.A. Michigan
exile Offline
User
exile  Offline
User

Joined: Apr 2005
Posts: 795
U.S.A. Michigan
You have to assign a shade-c shader to them.

Re: Shade-C v0.91 BETA S1 RELEASED [Re: exile] #408090
09/25/12 04:51
09/25/12 04:51
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Originally Posted By: exile
You have to assign a shade-c shader to them.


That isnt really efficient smirk
My map isnt selfmade, there are million of blocks ...

Re: Shade-C v0.91 BETA S1 RELEASED [Re: Ch40zzC0d3r] #408108
09/25/12 12:56
09/25/12 12:56
Joined: Apr 2005
Posts: 795
U.S.A. Michigan
exile Offline
User
exile  Offline
User

Joined: Apr 2005
Posts: 795
U.S.A. Michigan
I understand, but thats the way it has to be. Try assigning the "mtl_levelDefault" material to all of the blocks, they'll then render to the view. You have to remember that Shade-C is still in its infancy, and an easier solution may come to pass later. But at this time, thats the only way unless you already have shaders you wish to add to the Shade-C render chain which is a whole other can of worms in itself.

Re: Shade-C v0.91 BETA S1 RELEASED [Re: exile] #408111
09/25/12 14:54
09/25/12 14:54
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Isn't it possible to overwrite the default material that is used for blocks? Try to assign the shader to this default material.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Shade-C v0.91 BETA S1 RELEASED [Re: Dark_samurai] #408114
09/25/12 16:14
09/25/12 16:14
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
effect_load(mtl_shaded, "shadercode.fx"); loads some effect to the default material of blocks
maybe you need to set also some material event and data, but basically it should work with this


Visit my site: www.masterq32.de
Re: Shade-C v0.91 BETA S1 RELEASED [Re: MasterQ32] #408115
09/25/12 16:33
09/25/12 16:33
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
@Kartoffel: Looking forward to it! Let me know when you are finished and i might add it to the official build laugh

@Ch40zzC0d3r:
You have 3 options (there might be more):

1.)
Simply open up the shader's .fx you have been using before and overwrite it with a Shade-C objectshader. Have a look at the "example/fx/" folder for some example shaders. You'll see that it's VERY easy to set up your own shader.
Once you are done, make sure to set the material flag to ENABLE_RENDER and material event to sc_materials_event

2.)
Create a new material, assign a Shade-C objectshader to it. Also make sure to set material flags to ENABLE_RENDER and event to sc_materials_event. After you are done, have a look at d3d_automaterial in the manual. With d3d_automaterial = 4; you only have to assign a material to one dummy levelmesh (e.g. a small cube) which has the texture applied you want the material applied on. All other levelmeshes with the same texture will now have the material applied automatically. If you want to change the material again, simply change your dummy levelmesh.

3.)
As MasterQ32 suggested:
Code:
effect_load(mtl_shaded, "shadercode.fx");
mtl_shaded.flags = ENABLE_RENDER;
mtl_shaded.event = sc_materials_event;



Of course you can also do that with models/entities
Code:
effect_load(mtl_model, "shadercode.fx");
mtl_model.flags = ENABLE_RENDER;
mtl_model.event = sc_materials_event;




If i were you, i'd use method 3 to set a standard material and then go with method 2 to set specific materials if you need them.

If you have custom shaders in your game (e.g. trees/grass with wind animation in the vertexshader) have a look at example 05 on how to write and use custom shaders.




I really have to start working on the documentation, or at least a FAQ.


Last edited by BoH_Havoc; 09/25/12 16:36.

Shade-C EVO Lite-C Shader Framework
Re: Shade-C v0.91 BETA S1 RELEASED [Re: BoH_Havoc] #408129
09/26/12 02:24
09/26/12 02:24
Joined: Apr 2005
Posts: 795
U.S.A. Michigan
exile Offline
User
exile  Offline
User

Joined: Apr 2005
Posts: 795
U.S.A. Michigan
Quick question, does shade-c support sunlight? As in, does it have its own sunlight system? If not I think a sun lighting system would be pretty useful to have, and it would also go well with the terrains. Maybe a day-night system? Also I was wondering how to use the effects in sc_entity.

Last edited by exile; 09/26/12 05:19.
Re: Shade-C v0.91 BETA S1 RELEASED [Re: exile] #408138
09/26/12 09:28
09/26/12 09:28
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
Yes, sunlight is supported. As soon as sun_color is bigger than zero, sunlight is active. If you want shadows for the sun, use sc_screen_default.settings.lights.sunShadows = 1; (A8 only). var sun_light is also supported, so you can already simulate a simple day/night cycle (as seen in example 02...it's commented out though i think. Have a look at the while loop in main ).

Code:
//activate sunlight
vec_set(sun_color, vector(128,128,128));

//set camera as main view of sc_screen_default
sc_screen_default = sc_screen_create(camera);

/activate sun shadows
sc_screen_default.settings.lights.sunShadows = 1;

//setup Shade-C
sc_setup(sc_screen_default);

//simple day night cycle
while(1)
{

	//move the sun around the scene
	sun_angle.pan += time_frame; 
	sun_angle.pan %= 360; 
   	sun_angle.tilt = fsin(sun_angle.pan, 45) + 45;
   	//set the sunlight brightness
   	sun_light = sun_angle.tilt;
        wait(1);
}




I'll add an example on how to use the effects in sc_entity as well as sc_effects laugh


Shade-C EVO Lite-C Shader Framework
Re: Shade-C v0.91 BETA S1 RELEASED [Re: BoH_Havoc] #408143
09/26/12 13:02
09/26/12 13:02
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Thank you so much BoH_Havoc, its working fine!
I just got 1 more problem till shade-c is ready:
I have impact sprites and muzzleflash, both are black drawn, where they should be transparent, any Idea how to simply fix this?

Also, I found a bug:
When you are declearing a NEW view, and set it to show, shade-c is automaticly turned off. Sample.
Code:
VIEW *scopeRefView = 
{
	size_x = 2048;
	size_y = 1024;
	aspect = 1.4;
	clip_near = 1;
	flags = SHOW;
}


Last edited by Ch40zzC0d3r; 09/26/12 13:26.
Re: Shade-C v0.91 BETA S1 RELEASED [Re: Ch40zzC0d3r] #408176
09/26/12 21:24
09/26/12 21:24
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
I now improved the bloom and lensflare blending and added a vignette and a nice video grain effect to the hdr-view.

They're controlled by these floats:

sc_screen_default.settings.hdr.video_grain = (factor);
sc_screen_default.settings.hdr.vignette = (factor);

But I'm sorry, I didn't work on the second bloom-blur-stage because I've got a lot of other important stuff to do smirk

EDIT: I added this to the end of 'sc_hdr_init()' to randomize the position offset of the video grain texture.
Code:
while(screen.views.hdr)
{
   screen.materials.hdr.skill5 = floatv(random(1)); // Update video grain tex-coords
   screen.materials.hdr.skill6 = floatv(random(1)); // (same as above)
   wait(1);
}


Will this work properly or won't the loop stop when shade-c is reinitialized?
(afaik sc_hdr_init() is called again when reinitializing shade-c)

Last edited by Kartoffel; 09/26/12 21:32.

POTATO-MAN saves the day! - Random
Page 45 of 61 1 2 43 44 45 46 47 60 61

Moderated by  aztec, Blink, HeelX 

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