Shade-C v0.91 BETA S1 RELEASED

Posted By: BoH_Havoc

Shade-C v0.91 BETA S1 RELEASED - 06/22/09 15:13

[edit] What the...!, i forgot the download link! Here it is:
http://shadec.project-havoc.com/shade-c_v0.91_BETA_S1.rar

Snapshot 1 of the current Shade-C Beta version 0.91



FROM NOW ON, YOU HAVE TO GIVE CREDITS WHEN USING SHADE-C (OR PARTS OF IT) IN ONE OF YOUR PROJECTS.
IF YOU ARE CREATING A (COMMERCIAL) PROJECT/GAME, YOU HAVE TO SHOW THE SHADE-C LOGO ON STARTUP.
IF YOU MAKE A DONATION AT THE WEBSITE, YOU DON'T HAVE TO SHOW THE LOGO, BUT YOU STILL HAVE TO GIVE CREDITS.
IF YOU ARE USING ONLY SMALL PARTS OF SHADE-C IN YOUR PROJECT, YOU ONLY HAVE TO GIVE CREDITS, NO LOGO.
IF YOU ARE UNSURE IF YOU ARE USING SMALL PARTS OR NOT, JUST CONTACT ME.
I HAVE TO DEMAND THIS, AS THERE IS A SHADER-CONTEST GOING ON AND I DON'T WANT UNFAIR COMPETITION.

meh, i feel bad now...



Highlights in this version:
- dynamic softshadows for the sun. Not supersharp/ubercool and slow, but fast and robust. 2 Types are supported.
Type 0: Shadows are rendered directly on the models, no additional pass required, but you have to change your shaders accordingly. This leads to nice lighting and good fps. Should be used in final product
Type 1: Shadows are rendered in an additional pass, the result is then multiplied with the scene. This leads to bad lighting and fps drop. Can be used for rapid prototyping
- god rays, crepuscular light, volumetric light...you name it. Uses the depthmap as mask, so no additional pass has to be rendered. If DoF or dynamic water is being used (i.e. depthmap is used), using volumetric light has nearly no impact on framerate.
- you can now enable/disable/alter effects during runtime
- started creating examples on how to use each effect. Examples start with ex_
- for more new features/bugfixes, have a look at the included _readme.txt

Well, nothing spectacular, we have already seen all that stuff. But i hope my version of things are a little more user friendly and useable in an actual project smile

Screenshots:







WHAT'S NEXT?
- remove bugs wink
- Paraboloid Shadowmapping for Pointlights. Already working, but needs additional work.
- Add support for local volumetric light. Call volumetric light function for an entity, and rays will be sent out from this entities origin. 4 volumetric lights could be supported (i guess...)
- Add shadowmapping support to mtlFX.c shaders


[EDIT] THE MANUAL HASN'T BEEN UPDATED YET!

I hope this is of any use for you guys!
Have a nice week! wink



from the readme:
Quote:

22.06.09
Shade-C v 0.91 BETA Snapshot 1

FROM NOW ON, YOU HAVE TO GIVE CREDITS WHEN USING SHADE-C (OR PARTS OF IT) IN ONE OF YOUR PROJECTS.
IF YOU ARE CREATING A (COMMERCIAL) PROJECT/GAME, YOU HAVE TO SHOW THE SHADE-C LOGO ON STARTUP.
IF YOU MAKE A DONATION AT THE WEBSITE, YOU DON'T HAVE TO SHOW THE LOGO, BUT YOU STILL HAVE TO GIVE CREDITS.
IF YOU ARE USING ONLY SMALL PARTS OF SHADE-C IN YOUR PROJECT, YOU ONLY HAVE TO GIVE CREDITS, NO LOGO.
IF YOU ARE UNSURE IF YOU ARE USING SMALL PARTS OR NOT, JUST CONTACT ME.
I HAVE TO DEMAND THIS, AS THERE IS A SHADER-CONTEST GOING ON AND I DON'T WANT UNFAIR COMPETITION.

meh, i feel bad now...

WHATS NEW?
- fixed several bugs in sc_core.c and sc_core.h
- sc_skill is now working the way it should
- you can now enable/disable effects during runtime. To enable/disable an effect, set it's var accordingly (i.e. sc_bDOF = 1) and then call sc_setup() again *
- you can now change the screen resolution at runtime. Set you resolution with video_switch, video_set or any other function, then call sc_setup() again.
- you can now set effect parameters during runtime
- tuned hdr shader, it's a little faster now and looks a little better
- fixed bugs in volumetric particle shader and tuned it a bit. Looks better and is faster. There still are some minor bugs though. I guess i will rewrite the whole thing in the future
- added dynamic softshadows for the sun (uses parallel projected shadowmap and variance shadow mapping). Still needs efficient frustrum->depthmap projection to further improve the visual quality
- added A7 standardt material shader with dynamic softshadow support
- added dynamic softshadow support to all-in-one shader
- added environment illumination mapping to all-in-one shader
- changed lighting calculation of all-in-one shader to acknex style to better fit standardt A7 materials
- you can now use diffuse_red, ambient_red, specular_red, etc. together with the all-in-one shader
- added support for 8 dynamic lights to all-in-one shader. Moved light calculations from 2nd pass to the vertex shader of first pass. Removed 2nd pass. Shader is a little faster now.
- added god-ray/volumetric-sunlight/crespuscular-light shader. In contrast to other approaches, my version uses the depthmap as mask, so no additional pass has to be rendered. If you are using DoF or water, using volumetric light has nearly no impact on framerate.
- started creating examples for each effect. Have a look at the files beginning with ex_ . I will create more in the future.

(* see known bugs)


KNOWN BUGS
- watershader does not support 16:9 resolutions. I think i might end up integrating AbSu's watereditor anyway (if he lets me use it wink ), as he did a great job with it.
- fog doesn't work with all effects. I'm working on it
- If you enable the HDR shader at one time, you won't be able to disable it again. Leave sc_bHDR = 1 if you set it once, otherwise you will get bugs.
- Effects shouldn't be enabled/disabled to often. It's best to just set them in the game's options menu, not during gameplay. For best performance, restart your game after enabling disabling an effect, to reset video memory. Don't get me wrong, you can call sc_setup as much as you like, but it's not optimal. Restart your game whenever possible.
- If you are using WinAPI together with Shade-c, you can't enable/disable effects at runtime. Set your effect vars, then call sc_setup once. You also have to change these lines in sc_core.c

void sc_setup(){
//proc_kill(4);

//reset shade-c...
//(this is far from perfect, but it works kinda nice)
var screenRes = 0;
screenRes = screen_size.x;
wait(1);
video_set(screenRes-1,0,0,0);
sc_scSetup = 0;
wait(2);
sc_scSetup = 1;
video_set(screenRes,0,0,0);
//


to this

void sc_setup(){
//proc_kill(4);
/*
//reset shade-c...
//(this is far from perfect, but it works kinda nice)
var screenRes = 0;
screenRes = screen_size.x;
wait(1);
video_set(screenRes-1,0,0,0);
sc_scSetup = 0;
wait(2);
sc_scSetup = 1;
video_set(screenRes,0,0,0);
//
*/
sc_scSetup = 1;

I have no idea what's the cause for this behavior. I just started learning WinAPI myself and can't think of anything which would lead to this bug. Any suggestions?





DONATORS
Yasin Demirden
Björn "Uhrwerk" Zurmaar
Robert "rojart" Judycki

THANKS GUYS!

Soldier model by Darkyyes. Thanks!



'till next time
BoH_Havoc

Posted By: fogman

Re: Shade-C v0.91 BETA S1 - 06/22/09 15:25

Finally!
Nice improvements so far, I´m eager to test them out.
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/22/09 15:37

Cool!! Can wait to test it!! smile
Posted By: VeT

Re: Shade-C v0.91 BETA S1 - 06/22/09 15:43

This is great
I like this contest in general: it would help to improve shaders level of GS smile
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 06/22/09 15:52

Lol i'm so stupid, i forgot the download link laugh

Updated the first post with downloadlink. Happy testing! smile
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 06/22/09 16:06

well.. now we can flame anyone for saying 3dgs cant pull of great graphics... from thi part onwards, its up to the developers, not the engine smile... i'm going to test this now smile
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/22/09 16:10

@BoH_Havoc:
Quote:
FROM NOW ON, YOU HAVE TO GIVE CREDITS WHEN USING SHADE-C (OR PARTS OF IT) IN ONE OF YOUR PROJECTS.
IF YOU ARE CREATING A (COMMERCIAL) PROJECT/GAME, YOU HAVE TO SHOW THE SHADE-C LOGO ON STARTUP.
IF YOU MAKE A DONATION AT THE WEBSITE, YOU DON'T HAVE TO SHOW THE LOGO, BUT YOU STILL HAVE TO GIVE CREDITS.
IF YOU ARE USING ONLY SMALL PARTS OF SHADE-C IN YOUR PROJECT, YOU ONLY HAVE TO GIVE CREDITS, NO LOGO.
IF YOU ARE UNSURE IF YOU ARE USING SMALL PARTS OR NOT, JUST CONTACT ME.
I HAVE TO DEMAND THIS, AS THERE IS A SHADER-CONTEST GOING ON AND I DON'T WANT UNFAIR COMPETITION.

I have to do these in older versions, too??
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 - 06/22/09 16:30

finally a new version, Thank you so much BoH_Havoc.
The screens are looking awesome. Nice job!
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 - 06/22/09 16:35

mhh i get an error when i include it to my project:
Error in 'shade-c\sc_core.h' line 10: 'var' undeclared identifier
< var sc_myDepth = 1;
>

Also in the manual under Getting started i think

#include "sc_core.c";

should be

#include "sc_core.c"

EDIT: I placed
#include "sc_core.c"
after include acknex.h... and now i dont geht the error anymore. But now i get this error:
Error in 'shade-c\sc_shadows.c' line 55: 'D3DXMatrixOrthoLH' undeclared identifier
< D3DXMatrixOrthoLH(sc_orthoMat, SMRes*1.5, SMRes, 0.0, camera.clip_far*5);
>

Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 06/22/09 16:40

works for me.. but it makes some of my invisible models, visible.. strange, am sure its my code tho
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 - 06/22/09 17:48

Wow great. It runs on the Testlevel with 240 FPS! Thats good.

Hope to see the Releaseversion with all effects soon^^
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 06/22/09 18:02

Quote:
I have to do these in older versions, too??


In 0.90 you don't have to show a logo, only credits if you want. If you are using shaders from 0.90 in the upcoming shader contest, you HAVE TO give credits for fair competition. If you are using 0.91 or any later version, the new rules apply. Hope this clears things up smile

@Fear411: Have a look at the examples. The order of including files matters
Here's what your header should look like
Code:
#define PRAGMA_PATH "shade-c"

#include <litec.h>
#include <d3d9.h> // <--- THIS IS IMPORTANT!
#include <acknex.h>
#include <default.c>
#include "sc_core.c"


Quote:
THE MANUAL HASN'T BEEN UPDATED YET!




Quote:

works for me.. but it makes some of my invisible models, visible.. strange, am sure its my code tho


This is...strange, to say the least wink I don't think it's a problem on your side, at it was working before you used shade-c (at least that's what i guess?). Can you give some more details? Is it for models with set(my,INVISIBLE) or models with alphachannel or ... ?
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/22/09 18:15

Okay, i can put a logo, but i can't put a credit, because i don't have credits in my game. Oh well, i'll stick with 0.90. smirk
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 06/22/09 18:18

Well if you have the logo, you don't have to give credits, of course wink
And if you have a manual you can also give credits in there.
Just mention somewhere that you are using shade-c, that's all. smile
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/22/09 18:20

Great, thanks smile.
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 - 06/22/09 18:20

BoH_Havoc:

Jetzt hab ich doch noch ne Frage:
Der Shader bezieht sich jetzt auf die Schatten, oder auch auf die Shader der letzten Demo?

Also Deferred-Shader und SSAO. Weil in deiner Betaversion sind die mit dabei. Aber in der Main nicht. Oder ist das noch gesperrt?
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 - 06/22/09 18:23

i wonder if there is a way to get this to show up in GED. if so deving a level will be cake now.
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/22/09 18:49

Originally Posted By: lostclimate
i wonder if there is a way to get this to show up in GED. if so deving a level will be cake now.

Quoting TechMuc:
Originally Posted By: TechMuc
Am I allowed to implement Shade-C in my Editor

So YaaaaaaaaaaY!! laugh
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 - 06/22/09 18:52

So i found a Bug; i think.

With the Shade-C V 0.9 i can use models with Texture, Normalmap and Specular map. I use the GS Shader Specbump2.

If i use the V 0.91, than the models are invisible an no shader from GS work.
Posted By: Quad

Re: Shade-C v0.91 BETA S1 - 06/22/09 19:02

oh yeah, play time...
thanks mate.

edit:
Yasin Demirden? same Yasin Demirden as in Kabus22 right?


Shade-c was always good, best graphics contrubition.
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 - 06/22/09 19:04

@cowa, tech didnt make GED
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 06/22/09 19:18

Quote:

So i found a Bug; i think.

With the Shade-C V 0.9 i can use models with Texture, Normalmap and Specular map. I use the GS Shader Specbump2.

If i use the V 0.91, than the models are invisible an no shader from GS work.


I just tried every single shader that comes with A7 and they all work, except for fx_specBump2(); , that one gives an "undeclared identifier" error. Doesn't matter if i use shade-c or not, fx_specBump2(); is broken for me (although it's clearly defined in mtlFX.c ??).
Have you tried fx_specBump(); or any other shader? As mentioned, they all work for me, and i don't get any invisible models.
darkinferno are you also using fx_specBump2(); ?

Quote:

Also Deferred-Shader und SSAO. Weil in deiner Betaversion sind die mit dabei. Aber in der Main nicht. Oder ist das noch gesperrt?


Deferred Shading is included, but not supported. To unlock it, open up sc_core.c and comment
//#include "sc_deferred.c";
back in.
You can then activate deferred shading with sc_setupMRT(); and deferred shading + ssao with sc_setupMRT2();. I won't give any support however, as it's very beta and not really useable wink
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/22/09 19:26

Originally Posted By: lostclimate
@cowa, tech didnt make GED

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=25784&Number=216759
Posted By: XD1v0

Re: Shade-C v0.91 BETA S1 - 06/22/09 19:31

BoH_Havoc great work, your shader lib is awesome. As you can see i have a slow pc and my fps on your demo little more that 10, so i see some rendering bug(then i move the camera) in shadows demo, looks like sun depth map rendering after screen, maybe you need to set low layer for view(sun depth map rendering view).

Posted By: Slin

Re: Shade-C v0.91 BETA S1 - 06/22/09 19:45

Very cool smile
Do I see it right, that you don´t do anything to improve the shadow resolution and that it looks as good as it does just through the VSM?
And did you get rid of the lightbleeding or did I just not notice it in your example?
However, it works and looks very nice on my system smile
Posted By: fogman

Re: Shade-C v0.91 BETA S1 - 06/22/09 20:14

It´s the first outdoor shadow shader that works like a charme for me.
The modular approach is absolute fantastic.
I´ve included Shade-C and suddenly my level began to live.
Well I´m really exaggerated... I could run around and around, screamin´ "HOLY S***, HE´S _DA_ MAN!" grin

Edit: And I know that you´ve contributed to Shade-C as well.
Kudos to you all!
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 - 06/22/09 20:42

Merkwürdig. Nachdem ich deine Main komplett auskommentiert habe und dann wieder normal, läuft jetzt alles. Vielleicht irgendwas in einer Auslagerungsdatei? Jedenfalls läufts.

Ähm...wie kann ich den bei den GS-Shadern die Schatten draufbringen?
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 - 06/22/09 22:38

Originally Posted By: Cowabanga
Originally Posted By: lostclimate
@cowa, tech didnt make GED

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=25784&Number=216759


yes, thats ackbox, not GED
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/23/09 08:21

Well, it looks like GED. I guess the name has been changed.
Posted By: fogman

Re: Shade-C v0.91 BETA S1 - 06/23/09 08:25

GED is developed by Crew51 - no guesswork, simply a fact.
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 - 06/23/09 08:35

yep. they are two completely different tools, and they dont even look similar if you look for longer that 0.1 seconds at the gui.
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/23/09 08:38

Quote:
and they dont even look similar if you look for longer that 0.1 seconds at the gui.

lol laugh
Posted By: Quad

Re: Shade-C v0.91 BETA S1 - 06/23/09 08:55

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=32773&Number=269890#Post269890

?
Posted By: Cowabanga

Re: Shade-C v0.91 BETA S1 - 06/23/09 09:02

I was going to post that!! laugh
Posted By: TechMuc

Re: Shade-C v0.91 BETA S1 - 06/23/09 11:56

please do not speculate about an eventually existing basic-development program for GED in this thread. As anyone might have been noticed, the correct addressor for new features proposals for GED is jcl.

This thread is reserved for the fantastic development system Shade-C smile

@BoH: I'm pretty sure i got a lot of graphical errors in the demo on my laptop. I'll post screenshots later when i'm at home!
Posted By: Dark_samurai

Re: Shade-C v0.91 BETA S1 - 06/23/09 16:23

It's simply cool! Thanks for this great contributions.

The shadows aren't blurred on my system: ATI Mobility Radeon X1400

And the god rays are a little bit weird. They only show up if you are looking directly into the sun. Shouldn't they always be visible? I think also the look of the rays could be improved. Now they look a bit like a bit blurry, instead of looking like this: http://www.youtube.com/watch?v=N6r6tbf4UGU

But these are peanuts! Everything is working for me and looks great wink

Feature Request: Atmospheric Scattering
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 - 06/23/09 16:54

the shadows arent blured on my system,too
Geforce7300GS I know its bad wink
Posted By: Der_Kekser

Re: Shade-C v0.91 BETA S1 - 06/25/09 15:37

hello, it works, but if i use d3d_antialias it didn't work anymore
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 06/25/09 22:16

the shadows show brighter on some models than some? is there any material settings that i may tweak so that the shadow shows evenly... example, the shadow of the player is bright when being cast on a model but dull when casted on tha terrain... also, is there a way to reduce the brightness of the shadow?
Posted By: FBL

Re: Shade-C v0.91 BETA S1 - 06/26/09 18:14

I did a quick test with the sample level.
It's looking very cool already, but there are some issues on my system:

- shadows are not blurred and thus look very blocky
- resolution change seems to create bugs
- the longer I move around, the more flaws I get. Mainly shadow stripes going into nowhere
- after a few minutes the system hung, and after a few seconds of freeze, A7 closed itself. (no error message, but DirectX device is dead afterwards).

System: Geforce 7900GT, XP, Athlon XP 3500, 2Gig Ram, A7.77.0
Posted By: FBL

Re: Shade-C v0.91 BETA S1 - 06/27/09 13:24

I made a screenshot concerning the shadows:

Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 06/27/09 13:57

i dont get that prob with the shadows but once again, they are pitch black.. can i increase the brightness or something?
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 06/27/09 14:57

Thanks for the bug reports!

As there seem to be a lot of problems with the shadows, i changed some things (old shadows are still included, this is a new sType):
- Shadowmap gets encoded to a A8R8G8B8 (32bit argb) texture instead of a R32F (32bit floating point) texture. This runs on virtually any GFX Card and is also a little faster.
- Because of the encoding, Variance Shadowmapping can no longer be used, so i added a 3x3 PCF filtering instead. This doesn't look as good a vsm, but it's still nice and also runs on a lot of older hardware (should run on a GeforceFX and Radeon 9000, not tested though).

Here's what i still have to do (for performance optimizations and easier handling):
- Rewrite the global depthmap shader to encode it's map to a A8R8G8B8 texture
- Use that depthmap to draw full scene shadows (sType = 1) instead of rendering the full scene shadows in an additional pass. Will fasten things up a bit and shadows are drawn by deferred shading and not forward rendering. Might be useable for other things as well like ssao.
- Think of a way to get correct lighting when using scene shadows. This won't be perfect, but better than the current way how full scene shadows are added to the scene.

I will release a new snapshot next week so you guys can test the new shadows and see if they work or if you still get bugs.
If they do work, i will think about adding parallel split shadow mapping for better visuals. This will be another sType, so in the end you guys can choose exactly which shadows you want. Fast PCF filtered shadows which will run on a broad range of hardware, parallel split shadows with PCF which will be slower but nicer, variance shadows which will not run on all hardware, parallel split variance shadows which will (hopefully) look superb but will only make sense on high end GPUs.


Quote:
i dont get that prob with the shadows but once again, they are pitch black.. can i increase the brightness or something?


If you use sType = 0, you can increase the brightness with ambient_red/green/blue.
If you are using sType = 1, you can increase brightness by opening sc_vsmSun.fx in shade-c/fx and changing shadowAlpha. I forgot to include a simple method to change brightness through lite-c. Will include it in the next snapshot smile




Quote:
Do I see it right, that you don´t do anything to improve the shadow resolution and that it looks as good as it does just through the VSM?


Shadows are parallel projected and then use vsm. As you already said, there is nothing more to it wink

Quote:
Ähm...wie kann ich den bei den GS-Shadern die Schatten draufbringen?


At the moment you have to use sType = 1 to get shadows on gs-shaders. I'm working on it.

Quote:
And the god rays are a little bit weird. They only show up if you are looking directly into the sun. Shouldn't they always be visible? I think also the look of the rays could be improved. Now they look a bit like a bit blurry, instead of looking like this:


Good rays are indeed blurred a bit, so the shader doesn't have to use that many tabs and it will run on a broader range of hardware. As for the godrays only beeing displayed when looking into the sun: I don't know a method on how to do good looking godrays when not having the sun on screen. As soon as i find a fast solution for this, i will include it wink

Quote:
hello, it works, but if i use d3d_antialias it didn't work anymore


Yes, this is a known bug. I can't do anything about it.

Quote:
did a quick test with the sample level.
It's looking very cool already, but there are some issues on my system:

- shadows are not blurred and thus look very blocky
- resolution change seems to create bugs
- the longer I move around, the more flaws I get. Mainly shadow stripes going into nowhere
- after a few minutes the system hung, and after a few seconds of freeze, A7 closed itself. (no error message, but DirectX device is dead afterwards).

System: Geforce 7900GT, XP, Athlon XP 3500, 2Gig Ram, A7.77.0


You have to call sc_setup() again after changing the resolution. The DirectX device beeing dead after a few seconds sounds like you are calling sc_setup(), sc_smSunSetup(), sc_lightBeams() every frame in a while loop, which you shouldn't do. Do the examples work for you or do they also crash after a while?


Again, thanks for the feedback and sorry for all the bugs (especially the blocky shadows on some systems)
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 06/27/09 15:53

Update:
sType = 1 shadows don't produce wrong lighting anymore smile
You can now use every shader you want together with shade-c's shadows and it will most likely look correct smile

So no need to rewrite all those shaders to support shadowmapping *phew* Also makes things a lot easier for me when implementing point light shadows for dynamic lights in the future *yay*





This was actually easier than i thought ...
Posted By: FBL

Re: Shade-C v0.91 BETA S1 - 06/27/09 16:15

I only tried your sample when I wrote the report above.
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 06/28/09 00:20

the shadows jitter alot when moving, any way to correct this?
Posted By: HeelX

Re: Shade-C v0.91 BETA S1 - 06/28/09 09:07

Hi,

Shade-C is superb and I hope you keep on developing for a while to make everything perfect :-) Kudos to you!

Quote:
I don't know a method on how to do good looking godrays when not having the sun on screen. As soon as i find a fast solution for this, i will include it


You are using a radial blur starting at the position of the sun, right? Can't you make it work also for positions outside the screen? Then you could calculate the "virtual" sun position somewhere at the screen border and then do the godrays.

Quote:
Do I see it right, that you don´t do anything to improve the shadow resolution and that it looks as good as it does just through the VSM?


I guess he wanted to ask how he could improve the shadow map resolution. To be honest, I didn't recognized how to switch it, too.

Other question: is it the case that the shadow of the foliage of the tree isn't rendered correctly, I mean.. doesn't your shadow mapping support alpha textures?
Posted By: Slin

Re: Shade-C v0.91 BETA S1 - 06/28/09 09:19

Originally Posted By: HeelX
Hi,
Quote:
Do I see it right, that you don´t do anything to improve the shadow resolution and that it looks as good as it does just through the VSM?


I guess he wanted to ask how he could improve the shadow map resolution. To be honest, I didn't recognized how to switch it, too.


No, his answer was exactly what I wanted to know wink

Quote:

Other question: is it the case that the shadow of the foliage of the tree isn't rendered correctly, I mean.. doesn't your shadow mapping support alpha textures?


I think it does. The shadow resolution is just very low and thus you can only see it at the shadows edges.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 06/28/09 14:53

Quote:
I only tried your sample when I wrote the report above.


Do you get crashes with all samples or just some of them?

Quote:
the shadows jitter alot when moving, any way to correct this?


If you are using sType=1 shadows then you can't do anything about the jittering at the moment. I'm working on it.

Quote:
Shade-C is superb and I hope you keep on developing for a while to make everything perfect :-) Kudos to you!


I hope so too, as there's still a lot of work to do wink

Quote:
You are using a radial blur starting at the position of the sun, right? Can't you make it work also for positions outside the screen? Then you could calculate the "virtual" sun position somewhere at the screen border and then do the godrays.


Yes that's how it's done. I don't know how to get a good virtual sun vector in screen space yet to apply the radial blur center to. If i get that working, the rest is piece of cake (at least that's what i hope wink )

Quote:
Other question: is it the case that the shadow of the foliage of the tree isn't rendered correctly, I mean.. doesn't your shadow mapping support alpha textures?


Alpha maps are supported, but as slin already said: Shadowmap resolution is very low, so you sometimes don't notice it as everything is blurry.

void sc_smSunSetup(var SMMapRes, var SMRes, var SMdepth, float SMblur, var sType)
To give the shadows a sharper look, you can decrease SMRes. The lower it gets, the sharper the shadows are. However there also is a smaller area where shadows are being cast. You can also use a low value for SMdepth, this will also sharpen the shadows, but will decrease the maximal z distance of shadows.
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 - 06/28/09 22:42

Uhm...a very stupid question.

What the hell are Kudos? crazy
Posted By: HeelX

Re: Shade-C v0.91 BETA S1 - 06/28/09 22:56

Originally Posted By: Schmerzmittel
Uhm...a very stupid question. What the hell are Kudos?


Kudos means "fame" and "renown" resulting from an act or achievement. Extending "kudos" to an individual is often done as a praising remark.
Posted By: Quad

Re: Shade-C v0.91 BETA S1 - 06/28/09 23:01

http://www.urbandictionary.com/define.php?term=kudos

edit: i was late, again.
Posted By: Der_Kekser

Re: Shade-C v0.91 BETA S1 - 06/29/09 17:02

if i change the map the shadows are not correct. How can i change the map correct or is it not possible?
Posted By: BoH_Havoc

Re: Shade-C v0.91 | fast shadows - 07/08/09 22:13

Der_Kekser: I didn't think of adding support for level change. I'll have a look at it wink

While doing a simple projection shader example for an user i had an idea about a 6x faster way to render cubemaps for pointlights (or any other shader that could use them, realtime reflection for example). Tried it out today and guess what? IT WORKS! YAY!

I made a small testscene with one light casting shadows. At the moment it has no effect on framerate ( I get 512 fps, which is the highest i can get). So ... yeah ...lighting fast shadows grin wink

They are very ugly at the moment though, as there is absolutely no filtering activated and no diffuse lighting.
But i want you guys to test it, before i go on with it. Maybe it's not working for most of you guys (which i don't think, this uses very simple shadercode and only standardt texture formats)...but please test it so i can be sure it's working for most of you smile. This should run on a GeForceFX/Radeon9xxx

When testing, please write down the average fps you get and post it here. Also please post your highest fps possible in A7 (windowed, not fullscreen!) and also let me know what gfx-card you are using, so we can get some results for performance comparison smile

Downloadlink:
http://shadec.project-havoc.com/wip/fast_pointlight.rar

Screenshot how it should look: (yes, ugly shadows, but that's not the point here. I wanna know if the method for rendering the cubemap works for you guys wink )

Posted By: VeT

Re: Shade-C v0.91 | fast shadows - 07/08/09 23:35

what is this? grin
*run to download*
Posted By: VeT

Re: Shade-C v0.91 | fast shadows - 07/08/09 23:41

370-400 FPS on Radeon 9600 on Windows XP
270-300 FPS on Geforce 8600M GT on Windows 7

very good smile
Posted By: the_mehmaster

Re: Shade-C v0.91 | fast shadows - 07/09/09 00:20

Average 250 FPS on 512mb Geforce 9300M GS (notebook) with Windows XP.
Since my computer is a dual boot:
same specs with vista: = 230 FPS
Posted By: Marcus729

Re: Shade-C v0.91 | fast shadows - 07/09/09 03:15

I get this when I try to run from SED:
Error in 'MAIN' line 141: 'LF_activate' undeclared identifier

I ran it from the uncompressed RAR as well as after copying it into my 3DGS folder, version 7.77.

Can you tell me what I am doing wrong?

Thanks,
Marcus
Posted By: Poison

Re: Shade-C v0.91 | fast shadows - 07/09/09 06:44

220-230 FPS on nvidia gtx 260 and Windows Vista | processor clocked down to 800 MHz(Phenom II X4 945)
around 500 FPS(493-exactly 500) on nvidia gtx 260 and Windows Vista | processor standart Frq. 3000 MHz

So these are really fast shadows wink
Posted By: fogman

Re: Shade-C v0.91 | fast shadows - 07/09/09 08:47

Very nice!

~500 fps without any objects in the view
~400 fps with everything in the view

Win Vista
AMD Athlon 64 / 2,2 Ghz
nvidia 8600 gts
1534 MB Ram

Posted By: Dark_samurai

Re: Shade-C v0.91 | fast shadows - 07/09/09 08:49

60-90 FPS on ATI Mobility Radeon X1400 and Windows XP
Highest possible FPS in window mode: ~322

Waiting for a filter ^^
Posted By: Anonymous

Re: Shade-C v0.91 | fast shadows - 07/09/09 10:51

90-100 FPS when only a one or two objects are in view.
60-80 FPS when everything is in view.
200 FPS when noting is in view.

GeForce 7300GS
Windows XP
Intel Celeron 3.06GHz
1.5GB RAM
Posted By: Cowabanga

Re: Shade-C v0.91 | fast shadows - 07/09/09 12:06

Nice demo!! laugh

~160 FPS on WinVista SP2 with NVIDIA GeForce 8600 GT and 2 GB RAM.
Posted By: Zapan@work

Re: Shade-C v0.91 | fast shadows - 07/09/09 13:07

I Just get a black screen:

ATI X850 pl, (shader 2.0 Card)...
Posted By: splashmaker

Re: Shade-C v0.91 | fast shadows - 07/09/09 17:17

Good work! This runs very fast...

512 fps with no geometry
400 fps minimum when looking down on all objects

I am running this on:
Windows Vista 32 bit Ultimate
desktop composition disabled, all other windows minimized.
Core 2 extreme 2.8 ghz
8800mgtx
Posted By: Schmerzmittel

Re: Shade-C v0.91 | fast shadows - 07/10/09 00:12

In windowmode a constant fps from 512.

But i cannot swith to fullscreen.
Posted By: Puppeteer

Re: Shade-C v0.91 | fast shadows - 07/10/09 01:50

Always above 500
Geforce 8800GT
Windows XP
Posted By: Enduriel

Re: Shade-C v0.91 | fast shadows - 07/10/09 05:47

512 fps
8800GTX OC edition
AMD athlon 64 X2 5200+
Vista 64 bit
Posted By: ello

Re: Shade-C v0.91 | fast shadows - 07/10/09 07:22

just tested it at work on a nvidia 5700fx . and it runs with 55fps. i think for this crappy computer its running fast enough smile

i'll check how it works on my other pc's at home, later...

edit: ~470 on my notebook with the 6800 you already know wink
i guess this could leed to something really usable.
Posted By: JakeL

Re: Shade-C v0.91 | fast shadows - 07/10/09 20:15

512fps on GTX 285.

Wonderful work.
Posted By: darkinferno

Re: Shade-C v0.91 | fast shadows - 07/11/09 02:04

well, i got 180+ with all ents onscreen, 300+ without... also, off the current topic a bit, but i have no where else to post this, you used DDS textures for your terrain colormap, i cant edit dds, any freeware i can use? we dont all have photoshop, any ideas anyone?
Posted By: lostclimate

Re: Shade-C v0.91 | fast shadows - 07/11/09 02:42

for dds u can use gimp, but you need to get a plugin, you can find it easily with google.
Posted By: lostzac

Re: Shade-C v0.91 | fast shadows - 07/11/09 19:35

ok question...

Can anyone give me an idea on what would cause this to happen ?


It only happens when the sun starts to move...When my scene first loads up it looks normal...then about 1-2 seconds into the scene this happens to all my leaves...

I am not using any shaders on the leaves...just plain tga images ?
Posted By: BoH_Havoc

Re: Shade-C v0.91 | fast shadows - 07/12/09 14:51

Thanks for all the testing guys! Much appreciated smile Glad it works for almost all of you.

Strange thing though, that the shadowmapping is working fine on an old radeon 9800, but not on an X850 confused ati for teh_win ...

lostzac, so when the sun isn't moving, the shadow works fine? Strange...i'm quite sure i added support for a moving sun. Well, please wait for the next snapshot, this might be fixed then, as another shadowmapping algorythm will be used.

Yesterday i had an idea on how to render shadows for 3-4 lights at the speed of 1 fast light...so basically it wouldn't really matter if you have 4 lights casting shadows or only one, speed would be almost the same. If this works out, i might actually die of happiness, so let's hope for the best grin
Posted By: BoH_Havoc

Re: Shade-C v0.91 | fast shadows - 07/12/09 16:00

WEEEEEEE!

IT WORKS! smile

3 LIGHTS AT THE SPEED OF ONE! (I get 512 fps, again)

grin <- my face

Test + FPS + feedback please smile

download: http://shadec.project-havoc.com/wip/fast_pointlights.rar

Also , please compare it to the 1 light demo, and see if fps is nearly the same:
http://shadec.project-havoc.com/wip/fast_pointlight.rar

It's still ugly as hell, but again: That's not the point here smile

Posted By: Baum

Re: Shade-C v0.91 | fast shadows - 07/12/09 16:01

Is it possible to use shade-c with the trial version ?!
When I try to include it I get this:
Error in shade-c\sc_core.h line 10: var undeclared identifier
If you know if it is possible or what I am doing wrong please tell me... smile
Thanks!
Posted By: Dark_samurai

Re: Shade-C v0.91 | fast shadows - 07/12/09 19:37

4 Lights: ~60 FPS
1 Light: 60-90 FPS on ATI Mobility Radeon X1400 and Windows XP

Highest possible FPS in window mode: ~322

Very cool! What's the trick behind that?
Posted By: Schmerzmittel

Re: Shade-C v0.91 | fast shadows - 07/12/09 22:00

<- 512 in windowmode
<- constant 60 in Fullscreen.
Posted By: EvilSOB

Re: Shade-C v0.91 | fast shadows - 07/13/09 04:23

AMD Athalon 64X2 6400+, XP-SP3, 9800GT

Single-Light = solid 512fps, couldnt get lower
Multi-Light = solid 512fps, couldnt get lower
Posted By: Darkyyes

Re: Shade-C v0.91 | fast shadows - 07/14/09 13:57

currently running alot in the background, cpu intense aps

single light 500fps

Multiple lights 512 fps

getting better performance with multiple
trying to run it in fullscreen makes everything blink on and off like a disco ;p
Intel Q6600 @ stock 2.4 ghz, Windows 7 beta, Ati HD3870
Posted By: Quad

Re: Shade-C v0.91 | fast shadows - 07/14/09 14:06

probably it's my pc, but both demos crash after that white startup window and before the main engine window apears.
Posted By: Anonymous

Re: Shade-C v0.91 | fast shadows - 07/14/09 15:50

i get the same fps as in the demo with one light.
Posted By: splashmaker

Re: Shade-C v0.91 | fast shadows - 07/14/09 16:58

One question: Will these shadows work with vertex shader based animation?

I forgot to mention I get almost the same fps with 3 point lights as when rendering one point light. Good work again!
Posted By: Slin

Re: Shade-C v0.91 | fast shadows - 07/14/09 19:37

I am getting between 450 and 512fps, very inconsistant, but that of course doesn´t matter :P

I am wondering how you realize, that it runs that fast :P
The shaders are looking like basic cubemap pointlights...
Are you just rendering the depthmaps in different frames, which would probably be visible at lower framerates, or is there something much better?^^
Posted By: Cowabanga

Re: Shade-C v0.91 | fast shadows - 07/14/09 19:57

The new version:
~150 FPS.

Not bad, but still ugly. :P
Posted By: HeelX

Re: Shade-C v0.91 | fast shadows - 07/14/09 23:46

@BoH_Havoc:
Can't you make a screen-space blur and add a transparency value or such?

It runs fast as hell here, too... so I am interested how it behaves if you add postprocessing.
Posted By: Puppeteer

Re: Shade-C v0.91 | fast shadows - 07/16/09 03:19

Yeah
both versions always >500
Geforce 8800GT
EDIT: Are 4 lights possible too? =P
Posted By: the_clown

Re: Shade-C v0.91 | fast shadows - 07/16/09 09:03

Same here, both versions at around 512 - 400 fps, Geforce 9800GTX+. In fullscreen mode stable 60 fps.
Posted By: Foxfire

Re: Shade-C v0.91 | fast shadows - 07/16/09 22:15

your demo has the same problem that I've been having!

http://groundtacticsgame.com/cubemap_problem.jpg

the cubemaps are not being generated properly. This is definatley not your fault but a glitch in the A7 engine. I've already brought this problem up to their attention.

It is really good though. about 200 fps on both demos on my machine (8700GTm).

-Mike-
Posted By: Nowherebrain

Re: Shade-C v0.91 | fast shadows - 07/16/09 23:20

BTW to everyone posting the full screen fps, it will not be more than 60 in 3dgs..just in case some of you didn't know. I feel windowed is a better evaluation of speed.
Posted By: EvilSOB

Re: Shade-C v0.91 | fast shadows - 07/17/09 03:54

Nowherebrain is right, fullscreen limits your fps to your monitors refresh-rate.
Everytime I try (on multiple XP machines) it does anyways.
Posted By: BoH_Havoc

Re: Shade-C v0.91 | fast shadows - 07/17/09 12:52

Quote:
One question: Will these shadows work with vertex shader based animation?


No, this is a common problem when using shader based animations. Maybe there is a way to efficiently do it, but i don't know that solution yet.

Quote:
I am wondering how you realize, that it runs that fast :P
The shaders are looking like basic cubemap pointlights...
Are you just rendering the depthmaps in different frames, which would probably be visible at lower framerates, or is there something much better?^^


Yes, it's just basic cubemapped pointlights. I also tried around with dual paraboloid mapping. Works, but it's not that good looking.
Depth is rendered in different frames, yes. So as you already said, this will only work if framerate is above a certain amount.
I'm currently working on frustum culling for the depthmap views so the near/far planes get adjusted to the camera frustrum. I hope to get reasonable speed with "real" cubemapping then.
This is really funny, you need a fast pc to render the fast lights correctly. On the other hand, if you have a slow pc, you have to use the slow method, otherwise the shadows will lag ^^ Sometimes the hard reality plain sucks grin

So again for everyone: I can't do magic! These fast shadows will only work on high framerates. But i might be able to reuse parts of this test to include it in my final point light shadow algorythm to speed it up a little. I just wanted to know if there were any major problems with the general idea behind it wink

Quote:
Can't you make a screen-space blur and add a transparency value or such?
It runs fast as hell here, too... so I am interested how it behaves if you add postprocessing.


I'm currently working on a level for the shader-contest. Here's what it's looking like at the moment with local volumetric lights, fake HDR-R, DoF, refractions, water, per pixel lighting, screen-spaced depth-based blurred shadows and some other minor things. There's still a lot of work to do for the shadows as you can see from the shots.






and one without any shaders


Before someone asks, this runs at around ~90 fps. Minium is ~70, max is ~190.

Quote:
the cubemaps are not being generated properly. This is definatley not your fault but a glitch in the A7 engine. I've already brought this problem up to their attention.


I don't know if this is a problem with A7. I remember i didn't have those problems when i first toyed around with cubemapped pointlightshadows. But i think that was because my shadow epsilon was higher than in this demo, so "bad shadows" were just clipped away. Well, if i find out whats wrong and how to fix it, i'll let you know wink


Now back to that frustum culling...
Posted By: Shadow969

Re: Shade-C v0.91 | fast shadows - 07/17/09 14:58

looking awesome. good luck on the contest smile
Posted By: VeT

Re: Shade-C v0.91 | fast shadows - 07/17/09 15:01

I love it ^^
Posted By: Andreas C

Re: Shade-C v0.91 | fast shadows - 07/20/09 14:19


Sorry, if this is a silly question, but which of the "goodies" (e.g. DOF, refraction) can I disable and still get the shadow-stuff to work ?

I've got a level (using IntenseX) and wanted to add shade-c. I had to disable a few of the "goodies" because I kept getting a crash and since I am mostly interested in speedy shadows, I wasn't to worried.

But somehow, I don't get much of anything in terms of shadows ... obviously, I'm doing something wrong, but I just try to narrow down possible causes at this point.

Cheers,
Andreas
Posted By: BoH_Havoc

Re: Shade-C v0.91 | fast shadows - 07/20/09 15:42

You don't need any "goodies" for the shadows.
Just include sc-core.c, call sc_smSunSetup(..) somewhere in your script and you're set.
As long as you don't call sc_setup() somewhere, no "goodies" are activated wink

Have a look at ex_shadows1.c, ex_shadows2.x and ex_shadows3.c for more information on how to use sun shadows.

If you are after shadows for dynamic lights/indoor-levels: these are not implemented in the current version as i'm still working on them.



@ALL: I'm on vacation from today till 29. of July, so there will be no support during that time (PC has to stay at home wink ).

See you in August! smile
Posted By: Andreas C

Re: Shade-C v0.91 | fast shadows - 07/20/09 20:41


Hope you have a great vacation !

When you get back, maybe you can help me out a bit more on this ... when I load the examples you provide, everything seems to work just fine.

But in my level that uses IntenseX, I see no shadows like I see in your examples (I even loaded some of my models into your example level and they work fine ... apparently, IntenseX is counteracting shade-c ?).

Cheers,
Andreas
Posted By: CD_saber

Re: Shade-C v0.91 | fast shadows - 07/22/09 07:33

@Andreas C:

The easiest way to get ShadeC to work with IntenseX is to

1) deactivate IntenseX's "Display"-Script (if causes problems with ShadeC
2) rename the Skill99 (or skill100, iam not sure, just search for one of them) into Skill90, because IntenseX also uses this skill, so it conflicts with it.

Cheers, CD_SABER
Posted By: Schmerzmittel

Re: Shade-C v0.91 | fast shadows - 07/22/09 21:10

Will your testlevel be in shade-c?

Und nebenbei: Sieht einfach Hammer aus dein Testlevel. Weiter so.
Posted By: Schmerzmittel

Re: Shade-C v0.91 | fast shadows - 07/28/09 21:04

@Nowherebrain
Thats false.

If you deactivate your VSINC in the graphicsdriver, then you can have more than 60 FPS in Fullscreen. Ive tryed it. In Fullscreen it runs at 489 FPS.
Posted By: darkinferno

Re: Shade-C v0.91 | fast shadows - 07/28/09 21:17

i think it was a dumb idea for them to enable vsync in fullscreen by default... its restricting and i dont see why it would be hard to implement a simple switch such as:

var vsnyc=0; //0=off,1=on
Posted By: Schmerzmittel

Re: Shade-C v0.91 | fast shadows - 07/28/09 21:33

Oh..thas for JCL. BTW, 90% of the games out there use that. You can activate VSINC or not.

Hope that come in one fo the next update.
Posted By: DanielTruong

Re: Shade-C v0.91 | fast shadows - 07/30/09 03:32

A Stupid Question :
Do we have the Shade-C in C-Scrip ???
I need the Light-Ray effect in C-Scrip...!

would Anyone do it ? or show me how to convert it to WDL ???

thanks !
Posted By: BoH_Havoc

Re: Shade-C v0.91 | fast shadows - 07/31/09 11:44

Alright, back from vacation smile
Had an idea for fast point light based global illumination while taking a nap at the beach. I'm really curious if it will work out (it does work perfectly in theory...but that doesn't say anything grin )


There have been numerous reports of shade-c not working correctly with intense-x (all-in-one shader always fully lit, some post processing effects not working, etc), so please try CD_saber's solution and let me know if it works.
I will then make changes to the upcoming version of shade-c so it will work right from the start without the user rewriting parts of intense-x or shade-c.

Quote:

@Andreas C:

The easiest way to get ShadeC to work with IntenseX is to

1) deactivate IntenseX's "Display"-Script (if causes problems with ShadeC
2) rename the Skill99 (or skill100, iam not sure, just search for one of them) into Skill90, because IntenseX also uses this skill, so it conflicts with it.

Cheers, CD_SABER


@Schmerzmittel: Yes, testlevel will be "in shade-c" or lite-c if that's what you wanted to know wink It will make full use of the version im currently working on.

Quote:
A Stupid Question :
Do we have the Shade-C in C-Scrip ???
I need the Light-Ray effect in C-Scrip...!


Shade-C does not and never will work with C-Script. You have to use lite-c if you want to fully use shade-c. If you only want to use object-based shaders, then these will also work in C-Script. God-Rays will not work in C-Script however. Maybe check out the other thread over in "shaders", there's a god-ray shader over there that might work in C-Script.
Posted By: darkinferno

Re: Shade-C v0.91 | fast shadows - 08/01/09 10:38

question, how would i get shadows to show on a model that already has your terrain shader applied? i cant apply two effects to it?
Posted By: darkinferno

Re: Shade-C v0.91 | fast shadows - 08/01/09 15:00

also.. it seems sprites are casting shadows, is there an option to turn this off? works well for trees and such but horibble for explosions and such
Posted By: BoH_Havoc

Re: Shade-C v0.91 | fast shadows - 08/01/09 15:15

Quote:
question, how would i get shadows to show on a model that already has your terrain shader applied? i cant apply two effects to it?


Wait for the next release, you will be able to use any shader with shadows then. I plan to release the next version during august.

Short status update: The global illumination thingy is working kinda nice, but of course is far from perfect (massive fps drop).
For now, i dropped it and am now rewriting parts of the depthmap shader instead to create a hybrid renderer for shadows (deferred rendering <-> forward rendering). Shadows, ssao, ssgi and MAYBE lighting will be rendered by deferred rendering, all other shaders remain the same. The new deferred rendering will not use any floating point textures but encoded textures instead. So don't worry: If shade-c currently runs on your PC, it will also run on your PC after the hybrid renderer has been implemented.

I'm really looking forward to finishing this, as it will drastically reduce draw calls and polygons rendered per frame. So in theory this should give a nice performance boost when it comes to shadows. Now let's hope it actually works out smile


to-do list for august:
- finish frustrum culling for point light shadows
- implement deferred renderer which uses encoded textures instead of floating point textures, so it runs on a wide range of hardware
- move shadowmapping from forward renderer to deferred renderer
- update/create new examples
- update manual
- if there is time left: add support for local volumetric lights and fake global illumination

[edit]
Quote:
also.. it seems sprites are casting shadows, is there an option to turn this off? works well for trees and such but horibble for explosions and such


You are right. I will add an option for that.
Posted By: paracharlie

Re: Shade-C v0.91 | fast shadows - 08/20/09 23:49

Can someone explain to me what a water depth map is? Is it like a blendmap?
Posted By: paracharlie

Re: Shade-C v0.91 | fast shadows - 08/24/09 04:15

sleep
Posted By: BoH_Havoc

Re: Shade-C v0.91 | fast shadows - 08/24/09 11:39

Hi,
sorry for the late answer, i'm really busy these days. wink

A waterdepthmap is similar to a terrain heightmap. The only difference is, that a waterdepthmap contains the waterdepth instead of the terrainheight. wink
Posted By: skybluewildfox

Re: Shade-C v0.91 BETA S1 RELEASED - 08/30/09 09:59

hi im newbie in 3dgs and lite-c also..

im just wanna make animated and mirrored water in my project..
then, i found this tools, im using shade-c v0.90..
when i attach sc_water() method, my water model animate, but i got my water weird.. looks like this pict..



what's wrong with this? can somebody give me solution? im just learn lite-c..

thx before.. laugh
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 08/31/09 11:22

This looks like your version of A7 does not support Render to Texture...but it might also be another error, well see wink

Could you please tell me what version of A7 you are using?
Posted By: skybluewildfox

Re: Shade-C v0.91 BETA S1 RELEASED - 08/31/09 13:48

im using gamestudio pro 7.05/WED V6.8291.. Is that version doesnt support this?

But when i try ur demolevel, its run well..

im also have try to make animated water with c script, and it works, but im using lite-c in my project..

Is there any possibilities making animated water with my current 3dgs version and also using lite c??

Thx 4 ur help.. laugh
Posted By: Quad

Re: Shade-C v0.91 BETA S1 RELEASED - 08/31/09 14:06

update gamestudio and the problem will probably be solved.
Posted By: Rei_Ayanami

Re: Shade-C v0.91 BETA S1 RELEASED - 08/31/09 17:41

@Quadraxas: You don´t really believe this is normal Version ^^? I am sure he is using the pro version, right?
Posted By: paracharlie

Re: Shade-C v0.91 BETA S1 RELEASED - 08/31/09 21:28

If I remove the skins from my water thats what I also get. Sure you have your water plain setup right? Or maybe you are not calling shader correctly. You should have 3 skins setup in your water plain through MED if your using waterdepth or just 2 is needed.
Posted By: skybluewildfox

Re: Shade-C v0.91 BETA S1 RELEASED - 09/01/09 05:07

Originally Posted By: paracharlie
If I remove the skins from my water thats what I also get. Sure you have your water plain setup right? Or maybe you are not calling shader correctly. You should have 3 skins setup in your water plain through MED if your using waterdepth or just 2 is needed.


im using water.mdl from demolevel example, so the skins already attached to the water plane right? im sure because when i publish from WED, 2 others file (.bmp and .tga) are required when im using that water model..
Posted By: Helghast

Re: Shade-C v0.91 BETA S1 RELEASED - 09/01/09 10:00

Originally Posted By: skybluewildfox
Originally Posted By: paracharlie
If I remove the skins from my water thats what I also get. Sure you have your water plain setup right? Or maybe you are not calling shader correctly. You should have 3 skins setup in your water plain through MED if your using waterdepth or just 2 is needed.


im using water.mdl from demolevel example, so the skins already attached to the water plane right? im sure because when i publish from WED, 2 others file (.bmp and .tga) are required when im using that water model..


No... Just update to 7.80 pro, and all problems will be solved... If you cant update, contact conitec.

please people, keep this thread clean from SPAM about warez, conitec can solve this on their own...
wow, and i'm no mod tongue

anyway, I was wondering how easy it is to create a shader that works with Shade-C that simulates a fish-eye lense.
( Warped view on this image is what i mean )

regards,
Posted By: skybluewildfox

Re: Shade-C v0.91 BETA S1 RELEASED - 09/01/09 11:47

problem solved, i've upgrade to ver 7.80, all done..

thx all laugh
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/01/09 11:55

Quote:
anyway, I was wondering how easy it is to create a shader that works with Shade-C that simulates a fish-eye lense.



I think you can do that with camera.arc.
If not, you can archive this effect by applying a refraction shader to the scene, with a normalmapped sphere shape. Something like this (NOTE: you have to experiment a bit, this is not a perfect example):


some code to get you started:
Code:
BMAP* map_normal_fisheye = "normalmap_fisheye.bmp";
void v_fisheye()
{
	sc_mtl_pp_refract.skill1 = floatv(2.5); //this is the refract/bump strength
	sc_mtl_pp_refract.skill2 = floatv(0); //normalmap shifting speed. we don't want the normalmap to move, so set it to 0
	sc_mtl_pp_refract.skill3 = floatv(0); //refractmask factor. (Only) makes sense when using the depthmap as refractmask
	sc_mtl_pp_refract.skin1 = map_normal_fisheye; // assign the normalmap to the refraction shader
	
	sc_ppAdd(sc_mtl_pp_refract,camera,0); //apply refraction shader to screen
}




Just call this after sc_setup().
Or, if you don't use any other effects of shade-c and only want the fisheye effect, call this anywhere in your code.
Posted By: BoH_Havoc

Shade-C status update - 09/01/09 13:51

Thought i would give you a short status update:

Deferred Shading for low end gfx cards is working (Radeon 9800, Geforce FX). I will now start to add support for automatic detection of MRT capabilities and switch to high end deferred shading if MRTs are supported by the gfx card. This will give much better results as R32F textures will be used, but will also be a little slower. I will add an option to turn mrt support on or off, so you can decide if you need high end gfx or if it should run on a broad range of hardware.

I also started a little side project i do for university (create a mp shooter in 2 weeks as a proof of concept). While working on it, i stumbled over some nasty bugs in shade-c, which i fixed (hopefully). However i still have trouble using particles together with the new deferred shaders however. Also they don't really work well together with shadows. If this is fixed, i'm one big step further.
Also, for some reason view entities aren't rendered when sc_setup is called.

Also i noticed that sun shadows are not really suitable for big levels/flight sims. They work pretty good for first person shooters or 3rd person games...as long as you walk on the ground. So i will add pssm support for sun shadows to create nicer shadows (they will also be slower...but low end shadows are already supported by shade-c, so it's time for some advanced stuff wink Don't worry, you will be ablet to switch between low and "high end").

I think i will release a new version once automatic mrt detection is implemented and the particle bug is fixed.
I wanted to release a new version yesterday, but there are to many bugs right now and no real improvements (apart from the shadows working on low end systems).


Oh yeah, while working on my project, i also created a new terrain shader. It supports global color- and normalmapping, an unlimited number of detail color- and normalmaps, environment illumination mapping, specular lighting, 8 dynamic lights and shadowmaps.

Still have to work on it a little (ambient lighting isn't working the way it should at the moment), but here are some screens of it in action:







Posted By: Pappenheimer

Re: Shade-C status update - 09/01/09 14:03

Quote:
Deferred Shading for low end gfx cards is working (Radeon 9800, Geforce FX).

Does any demo already work this way?
I ask, because I couldn't test any of the contest entries, because they all used shader 3.0.
Posted By: BoH_Havoc

Re: Shade-C status update - 09/01/09 14:43

As far as i know my contest entry "only" needs ps 2_a .
However it still uses r32f textures for the shadows, so that might be the cause for it not working correctly on your pc.

There currently is no demo showcasing the low end shadows.
I will add options to my game for switching to low end shadows however. So you will get your demo, along with a tiny multiplayer shooter laugh And as i have a fixed deadline, this won't take too long wink
Posted By: Helghast

Re: Shade-C v0.91 BETA S1 RELEASED - 09/01/09 14:50

WOW!

that was easy enough tongue

I took your code, and adapted it to this:
Code:
BMAP* map_normal_fisheye = "normalmap_fisheye.bmp";
void v_fisheye()
{
	sc_mtl_pp_refract.skill1 = floatv(0.8); //this is the refract/bump strength
	sc_mtl_pp_refract.skill2 = floatv(0); //normalmap shifting speed. we don't want the normalmap to move, so set it to 0
	sc_mtl_pp_refract.skill3 = floatv(0); //refractmask factor. (Only) makes sense when using the depthmap as refractmask
	sc_mtl_pp_refract.skin1 = map_normal_fisheye; // assign the normalmap to the refraction shader
	
	sc_ppAdd(sc_mtl_pp_refract,camera,0); //apply refraction shader to screen
}



then change the normalmap to this:


Next change the camera arc to 110...
Code:
camera.arc = 110;



and BAM! this is the result:




Now I knew about changing the camera arc, but that wouldnt add the curving in my geometry as you can see happening on this image... I'm really happy now grin thanks!

Only thing though, it does seem to make the game look refracted (on a tiny scale)... I guess it's due to the "refraction"-shader tongue But would there be a more smooth way?
If you dont know what i'm talking about, try the above and see for yourself.

kind regards,
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/01/09 16:29

To get rid of the aliasing that's bothering you, create a normalmap that is at least as big as the screen. As with every other texture the normalmap will be blurry and have artifacts if it's scaled up beyond it's initial width and height.

Ideally you would also not create a square normalmap, but a 4:3, 16:9 or 16:10, depending on you resolution. That way the pixel aspect ratio will always be correct and you won't get any refracting artifacts in your map wink

So for a screen res of 1024x768, create a normalmap that is at least 1024x768 in size. As long as it has the same aspect ratio it should work just fine.
Posted By: Nowherebrain

Re: Shade-C v0.91 BETA S1 RELEASED - 09/01/09 18:34

I am enamored with this new terrain shader........WOW.
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 RELEASED - 09/02/09 01:12

the new terrain shader is beautiful grin

@joozey

The typical mtlfx file comes with a good fishlense shader already if you check it out.
Posted By: Helghast

Re: Shade-C v0.91 BETA S1 RELEASED - 09/02/09 11:08

Originally Posted By: lostclimate
the new terrain shader is beautiful grin

@joozey

The typical mtlfx file comes with a good fishlense shader already if you check it out.


Helghast you mean tongue?

Anyway, yes, but I had NO idea how to change the settings, this works with an image, lots easier to me now wink

thanks though, i'll look more into it laugh

regards,
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 RELEASED - 09/02/09 13:03

oh yeah helghast (not sure why i thought joozey wanted to know) anyways, i adjusted it just by opening the .fx file and about halfway down there is a variable set to a hexidecimal value, That changes the strength of it.
Posted By: Helghast

Re: Shade-C v0.91 BETA S1 RELEASED - 09/03/09 13:21

Originally Posted By: lostclimate
oh yeah helghast (not sure why i thought joozey wanted to know) anyways, i adjusted it just by opening the .fx file and about halfway down there is a variable set to a hexidecimal value, That changes the strength of it.


nice, thanks for the hint grin I'll see what gives better results to me eventually (I dont care about performance right now :P)

But as i'm using Shade-C anyway, thought I might wanna do it in there anyway laugh

regards,
Posted By: Landixus

Re: Shade-C v0.91 BETA S1 RELEASED - 09/04/09 15:51

Das ist ja nen goiles Dingens, das bau ich bei mir mit ein laugh

85 FPS!



Genau das was ich gesucht hatte, passt wunderbar in mein Spiel!
Und da ich nen CoderDepp bin ist das nochmal so gut laugh

Danke dafür.

Ich halte mich natürlich an die Credits Regelung
wenn es soweit ist.
Posted By: skybluewildfox

Re: Shade-C v0.91 BETA S1 RELEASED - 09/05/09 16:53

Originally Posted By: skybluewildfox
problem solved, i've upgrade to ver 7.80, all done..

thx all laugh


hmmm, unfortunately the problem hasn't truly resolved..

before ,, im trying to install ver 7.80 trial and I copied all project folder (main.cd included) from my project folder in my PC to my friend's notebook and publish it in WED, then i run main.exe there and the water shader works well..
I think the problem has resolved with compile my project with that version..
but actually the water shader can't work in other computer (with same platform, i have tried with 6 other computer with different platform and the same platform)..

lately, i know that trial version can't publish *.exe.. So, it means main.exe that i run in my friend's computer is generated (compiled) from my old version of 3dgs(7.05), right?

can anybody explain what exactly happened here? pls help me with the solution..
thx before.. laugh
Posted By: skybluewildfox

Re: Shade-C v0.91 BETA S1 RELEASED - 09/05/09 17:17

=sorry double post=
Posted By: Tai

Re: Shade-C v0.91 BETA S1 RELEASED - 09/09/09 16:47

Just looking for some advice with radial blur. I got Shade-C up and running, so that's good, but I've been unable to get radial blur to work. Can somebody give me a snippet for enabling it? I'm still really unfamiliar with shaders in general.
Posted By: Widi

Re: Shade-C v0.91 BETA S1 RELEASED - 09/21/09 19:20

Hello BoH_Havoc, first congratulation to this beautyfull shaders.

I have a question: Your outdor Demolevel includes the actions "sc_warpgateExit" and "sc_shield". But i don`t can find the two actions in the download - folder. Is it possible to become this code?

Thanks.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/22/09 16:00

Oops, you are right, looks like 2 included files were missing.

Here you go:
http://project-havoc.com/upload/shadecDemo_missingFiles.rar
Posted By: Widi

Re: Shade-C v0.91 BETA S1 RELEASED - 09/22/09 16:38

Thanks a lot ....
Posted By: Widi

Re: Shade-C v0.91 BETA S1 RELEASED - 09/24/09 16:01

Have now all, it works. But i have a little problem:

In my indoor level i want to use "fog_color = 1;", but if i set this, the sc_heathaze, sc_shield and sc_warpgate that i want to use in my project don`t shows up right. It shows only a black transparency point.
Posted By: MrFloppy

Re: Shade-C v0.91 BETA S1 RELEASED - 09/28/09 11:47

hey I just registered in this board because of this topic.
i downloaded the latest code with the example files and tried to run them.
but i get the error message that the sc_core.c file can not be found and that
the material sc_mtl_obj_heathaze is an undeclared identifier...

same problem after including in my project like written in the help file.

i searched of a solution in this board but seems that my problem is very specific.
thank for any answer
Posted By: Tai

Re: Shade-C v0.91 BETA S1 RELEASED - 09/28/09 18:34

Did you define PRAGMA_PATH?
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 RELEASED - 10/19/09 22:59

Öhm...gibt es schon was neues von Shade-C oder ist das Project eingestampft worde!?
Posted By: Ayumi

Re: Shade-C v0.91 BETA S1 RELEASED - 10/20/09 07:10

er hat zur Zeit viel um die Ohren, von daher kaum Zeit sich dem Project
zu widmen.Einfach etwas geduld haben, ein update folgt bald;)
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 RELEASED - 10/20/09 21:02

Achso...na dann. Hatte das gar nicht mitgekriegt^^
Hab selber so viel um die Ohren.

Tja dann auf frohes warten und weniger Zeugs um den Ohren crazy
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 10/22/09 22:59

As Ayumi already stated, i have lots of work to do at the moment. But you can be assured that this project is far from death. I got an interisting mail a few days ago. If things work out, there will be realtime radiosity in the future (don't hold your breath, it won't look as pretty as in prerendered scenes of course. But it will definately look nice, that's for sure laugh )

I have fixed a lot of small bugs in the last weeks, tried to improve shadows (they are a little faster now, but still don't work the way i want), there's projective texture mapping and per object shadows. There's deferred lighting for all gfx cards which support pixelshader 2.0. There's a new terrain shader. But it's all not working nicely right now. I want things be as easy to use as possible and as fast as possible.

If i ever drop shade-c, i will let you guys now wink
Posted By: BastovBros

Re: Shade-C v0.91 BETA S1 RELEASED - 11/10/09 18:27

I cannot run shade-c, because all the time when I try to run the project, the error "include sc_core.c can't be found" , I've done everything as it was written in the manual:placed the shade-c folder in teh work folder, define PRAGMA_PATH "shade-c", #include "sc_core.c".... still nothing helps, cannot run the project..... HELP!!!!
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 11/10/09 18:33

you have to include more than that, use:

#define PRAGMA_PATH "shade-c"
#define PRAGMA_PATH "shade-c\\fx"
#define PRAGMA_PATH "shade-c\\bmap"
#define PRAGMA_PATH "shade-c\\stuff"
Posted By: BastovBros

Re: Shade-C v0.91 BETA S1 RELEASED - 11/10/09 19:01

This does not help, I tried, because "sc_core.c" file is located in the shade-c folder..... I do not need other folders (they are already included in sc_core.h file).... there must be some other problem....
Posted By: Nowherebrain

Re: Shade-C v0.91 BETA S1 RELEASED - 11/21/09 14:51

try to put it in your work folder if nothing else works.
Posted By: Nowherebrain

Re: Shade-C v0.91 BETA S1 RELEASED - 02/20/10 00:36

You still working on this??? It is already good, but...just curious.
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 02/20/10 03:58

yes he is, take a look at my scion thread to see
Posted By: Nowherebrain

Re: Shade-C v0.91 BETA S1 RELEASED - 02/20/10 16:38

the game I have seen....(nice), but I am particularly interested in the new terrain shader he was working on....
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 02/21/10 10:42

am not entirely sure if he wants me giving out info on it but all i can say is that he's still working on it all
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 02/21/10 10:58

I found one bug laugh When I look directly in to the sun, and shoot(creating muzzle sprite), muzzle flash is not overlay... looks really bad frown If I switch off god rays, works normal. And how can I make shadows smoother? In all other ways just some great work is done here! Keep it up! wink
Posted By: Nowherebrain

Re: Shade-C v0.91 BETA S1 RELEASED - 02/21/10 17:06

Thanks darkinferno, I will hold my breath.
Posted By: Fab4

Re: Shade-C v0.91 BETA S1 RELEASED - 03/16/10 20:46

Hi guys,
I'm trying to use the terrain shader from shade-c project, but there appears always the same bug "?" ...

As you can see on the picture the endings of the tiles are very edged and not seamless.
Does anybody know what I'm doing wrong?

The same effect also appears by using the original stuff from the shade-c demo level, but in the demo it runs fine.

I tested it on two computers with different graphic cards.

[edit]
the textures are seamless, but there seems to be a cut near the border.
i also tried to correct the mipmaps. but as i said its the same with havocs textures and they work as you can see in his demo level.

[edit]
I solved it by changing the sc_myDepth value, but if anyone has a another solution..please let me know
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 RELEASED - 03/16/10 21:18

well commonsense would tell you that you need a seamless texture.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 03/17/10 19:11

helooo.. i no understand..
for that it this?
effecs.c and effecs.h that havoc publish for download?
Posted By: Nidhogg

Re: Shade-C v0.91 BETA S1 RELEASED - 03/18/10 01:49

A seamless texture is a texture that, When joined you will not see the join lines.
There is a utility somewhere in these forums or google for seamless texture and you will find programs that will assist you in creating them.

Good luck.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 03/18/10 18:11

How I configure shadec for use in closed environments?
my project is indoor and outdoor.
for my outdoor cene the shadec is very vary good..
however I do not obtain to configure it of the adequate form.
somebody could help me please?
Posted By: Fab4

Re: Shade-C v0.91 BETA S1 RELEASED - 03/19/10 13:25

....my textures are seamless^^ I don't know why it looks like that. And as I said before: it's the same with havocs textures. So the problem is not caused by the textures.
Posted By: Nidhogg

Re: Shade-C v0.91 BETA S1 RELEASED - 03/20/10 16:22

It maybe a problem with how you've done your startup settings.

If you don't know how to do that, then read the manual or look at Havoc's code.
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 RELEASED - 03/20/10 18:58

Originally Posted By: Fab4
....my textures are seamless^^ I don't know why it looks like that. And as I said before: it's the same with havocs textures. So the problem is not caused by the textures.


hmm thats wierd then i have no idea what the issue would be.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 03/24/10 14:35

Helooo.. i go post screenShots of the havoc Beta Release witch TeamColor and LUMMAPPING.

http://uploaddeimagens.com.br/imagem/index/19602.jpg
http://uploaddeimagens.com.br/imagem/ver/67801.jpg
http://uploaddeimagens.com.br/imagem/ver/team_color_lumina.jpg
http://uploaddeimagens.com.br/imagem/ver/8team_color_lumina.jpg
http://uploaddeimagens.com.br/imagem/ver/team_color_lumina2.jpg

I tried to place the images here however he did not function, therefore I placed links
Posted By: Landixus

Re: Shade-C v0.91 BETA S1 RELEASED - 03/24/10 14:54

nice Link laugh
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 03/25/10 20:40

kkkkkkkkkkkkkkkkkkkkkk
XD
ohhhh Soryyy soryyyyyyy brother...
Now i edit the up post rsrsrsrs. kk
Sory..

Already I corrected links in post previous, sees there
(^.^)
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 04/01/10 19:07

LumMap



TeamColor



normal


Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 04/01/10 19:12

hii hii havooocc.. plz
how I make volumetric fog?
Posted By: Nidhogg

Re: Shade-C v0.91 BETA S1 RELEASED - 04/02/10 03:11

There is a fog shader that has just been added in the resources forum
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 04/05/10 15:19

said
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/11/10 17:28

when do you think is the next updated version (not the beta) of this comming out? can you give us an estimate?
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 04/11/10 21:06

There will be a major update soon.
It's a complete rewrite (once again), but it's compatible with the last version.
The whole thing is A LOT faster now (eg. refractions are ~75% faster). Also shadows are way better looking than in the last version.

I'll post screens very soon wink (Some first impressions can be found here: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=315961#Post315961 )
Posted By: Widi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/11/10 21:12

Great, don`t can wait for it...
Thanks a lot
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 04/12/10 13:21

Ohhhhhhh much much tankx havoc.. you is my IDOL m(^.^)m
I am waiting Anxious for the update.
thanks a lot havoc. Without you 3dgs would not be the same (^.^)
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/13/10 18:25

The fact that I have the opportunity of inputing a shadowmap on a second uv set solved all the problems with rendering speed and really does make the difference!
Which is something that gamestudio's shadows can't do.
The cool part is that it's a bitmap so i can draw whatever I like in it and in my case I do ambient occlusion, shadowmap, and lightmap all in one!


Click to enlarge: http://www.themasquerade-guild.com/shadec.jpg
Posted By: EvilSOB

Re: Shade-C v0.91 BETA S1 RELEASED - 04/13/10 18:40

Fab4,
have you still got that problem with the seamless textures still?

Is your texture a "power of 8" in width and height? (Because the image youve posted isnt)

AFAIK, all textures need to be a power-of-eight in dimension for
direct-x to handle them properly.
eg sizes: 8x8, 16x64, 256x1024, 512x512. Them sort of numbers...
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 04/13/10 19:23

How I make my dynamic light to influence my terrain:?
see my image post.
The light reaches the constructon model and the welded models however do not influence terrain.
why???

Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 04/13/10 20:55

PietroNifosi: Nice pics! Do you have any pics with shadows on the terrain, too? Also chances are high you won't need static shadowmaps anymore with the upcoming version... wink

NeoNeper: Try this shader instead (will also automatically use the A7 shadowmap if it's a .hmp with shadows compiled in WED):
Code:
/*
Terrain-Shader by Wolfgang "BoH_Havoc" Reichardt
Automatically uses A7 lightmap if its a .hmp file instead of a .mdl

Entity Textures:
	Skin1 = Global Colormap
	Skin2 = Tile-Colormask  (RGB) + Shadow (A)
	Skin3 = Global Normalmap
	Skin4 = Tile-Normalmap (RGB) + Specularmap (A) (Quad-Texture)

Material Textures:
	Skin1 = Tile-Color (Quad-Texture @ DDS)

Usage:

	
*/

/***************************************TWEAKABLES*****************************************************/

float bumpStr = 2; //bump strength
float numTiles = 60; // number of tiles
float shadowAlpha = 0.5; //shadowalpha of bumpmapping
float texShadowAlpha = 0.25; //shadowalpha of shadowtexture
float velvStr = 0.4; //velvety strength
float specStr = 1.0; //specular Strength
float4 specPower = 10; //specular Sharpness, higher value = sharper specular lighting

//active dynamic shadows (shadowType = 0)
//#define DYNSHADOW

//activate velvety backlight
#define VELVETY

/***************************************SHADER*CODE****************************************************/

texture entSkin1; //colormap
texture entSkin2; //global normalmap + Shadow
texture entSkin3; //colormask
texture entSkin4; //normalmaps
texture mtlSkin1; //colormaps
texture LightMap; //lightmap passed by engine

matrix matWorld;
matrix matWorldInv;
matrix matViewInv;
matrix matWorldViewProj;
float4x4 matEffect1;
float4x4 matEffect2;
float4x4 matEffect3;

float4 vecSunDir;
float4 vecSunColor;
float4 vecLightPos[8];
float4 vecLightColor[8];
float4 vecViewPos;
float4 vecAmbient;
float fAmbient;



//do sunlight
#define DOSUN

sampler colorSampler = sampler_state 
{ 
   Texture = <entSkin1>; 
   MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
};

sampler maskSampler = sampler_state 
{ 
   Texture = <entSkin2>; 
   MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
}; 

sampler globalNormSampler = sampler_state 
{ 
   Texture = <entSkin3>; 
   MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
}; 

sampler normSampler = sampler_state 
{ 
   Texture = <entSkin4>; 
   MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
}; 

sampler tileColorSampler = sampler_state 
{ 
   Texture = <mtlSkin1>; 
   MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
};

sampler2D lightmapSampler = sampler_state
{
	Texture = <LightMap>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
	AddressU = WRAP;
	AddressV = WRAP;
};



#ifdef DYNSHADOW
// ShadowDepth map sampler
texture sc_map_shadowDepthSun_bmap;

sampler ShadowMapSampler = sampler_state
{
	Texture = <sc_map_shadowDepthSun_bmap>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
	AddressU = CLAMP;
	AddressV = CLAMP;
};

Texture sc_map_shadowAlpha_bmap;

sampler ShadowAlphaSampler = sampler_state
{
	texture = <sc_map_shadowAlpha_bmap>;
	magfilter = LINEAR;
	minfilter = LINEAR;
	mipfilter=LINEAR;
	AddressU = clamp;
	AddressV = clamp;
};
#endif

///////////////////////HELPER FUNCTIONS///////////////////////////////////////
// calculate the light attenuation factor
float DoLightFactor(float4 Light,float3 Pos)
{
   float fac = 0.f;
   if (Light.w > 0.f) {    
      float LD = length(Light.xyz-Pos)/Light.w;
      if (LD < 1.f)
         fac = saturate(1.f - LD);

   }
   return fac; // get the distance factor
}

// calculate the light attenuation factor on the front side
float DoLightFactor(float4 Light,float3 P,float3 N)
{
	float3 D = Light.xyz-P; // ray pointing from the light to the surface
	float NdotL = dot(N,normalize(D));   // angle between surface and light ray
	
	if (NdotL >= 0.f) 
	   return saturate(NdotL*8)*DoLightFactor(Light,P);
	else
	   return 0.f;
}

float DoLightFactorN(float4 Light,float3 P,float3 N)
{
	float3 D = Light.xyz-P; // ray pointing from the light to the surface
	float NdotL = dot(N,normalize(D));   // angle between surface and light ray
	
	if (NdotL >= 0.f) 
	   return 2 * NdotL * DoLightFactor(Light,P);
	else
	   return 0.f;
}

float4 DoPointLight(float3 P, float3 N, float4 Light, float4 LightColor)
{
	return LightColor * DoLightFactorN(Light,P,N);
}

float4 DoLight(float3 P, float3 N, int i)
{
	
	if(vecLightPos[i].w < 100000) return DoPointLight(P,N,vecLightPos[i],vecLightColor[i]);
	else return 0;
}


float4 doLighting(float3 P, float3 N, int i)
{
	if(vecLightPos[i].w < 100000)
	{
		float4 lighting = 1;
		lighting.xyz = clamp(1-distance(vecLightPos[i].xyz,P)/vecLightPos[i].w,0,1);
		lighting.xyz *= dot(N,normalize(vecLightPos[i]-P))*vecLightColor[i].xyz;
		return lighting;
	}
	else
	{ 
		return 0;
	}
	
}

float light_vsm_epsilon = 0.00003;
float light_shadow_bias = 0.0025;

float doVSM(float2 depthmap, float lightDepth)
{
     	//depthmap.y = (depthmap.x * depthmap.x);
     	float lit_factor = (lightDepth <= depthmap.x);
    	
    	// Variance shadow mapping
    	float E_x2 = depthmap.y;
    	float Ex_2 = depthmap.x * depthmap.x;
    	float variance = min(max(E_x2 - Ex_2, 0.0) + light_vsm_epsilon, 1.0);
    	float m_d = (depthmap.x - lightDepth);
    	float p = variance / (variance + m_d * m_d);
    	
    	// Adjust the light color based on the shadow attenuation
    	return 1-max(lit_factor, p);
}

void terrain_VS( 
   in float4 InPos: POSITION, 
   in float3 InNormal: NORMAL, 
   in float2 InTex: TEXCOORD0,
   in float3 InTangent : TEXCOORD0,
   out float4 OutPos: POSITION,
   out float4 OutColor : COLOR0,
   out float2 OutTex: TEXCOORD0, 
   out float4 OutLight: TEXCOORD1,
   out float3 OutViewDir: TEXCOORD2,
   out float3 OutWorldNormal	: TEXCOORD3,
	out float3 OutWorldTangent	: TEXCOORD4,
	out float3 OutWorldBinorm	: TEXCOORD5,
	#ifdef DYNSHADOW
		out float3 OutWorldPos	: TEXCOORD6,
		out float4 OutShadow	: TEXCOORD7
	#else
		out float3 OutWorldPos	: TEXCOORD6
	#endif
	) 
{ 
	// Transform the vertex from object space to clip space: 
   OutPos = mul(InPos, matWorldViewProj); 
	// Pass the texture coordinate to the pixel shader: 
   OutTex.xy = InTex.xy;
   
   float3 PosWorld = mul(InPos, matWorld);
  	
   //Light
   #ifdef DOSUN
	   OutLight.xyz = -vecSunDir.xyz;//vecSunPos - PosWorld;;
	   OutLight.w = 100000;//distance(PosWorld,vecLightPos[0])/vecLightPos[0].w;
   #else
	   OutLight.xyz = vecLightPos[0] - PosWorld;
	   OutLight.w = 0;
	   if(vecLightPos[0].w < 100000) OutLight.w = 1-distance(PosWorld,vecLightPos[0])/vecLightPos[0].w;
   #endif
  	//

	//Specular Lighting
	OutViewDir = matViewInv[3].xyz - PosWorld;
	//
	
	//Misc Output
	float3 Binormal = cross(InNormal,InTangent);
	OutWorldNormal.xyz = mul(InNormal, matWorld).xyz;
	OutWorldTangent.xyz = mul(InTangent, matWorld).xyz;
	OutWorldBinorm.xyz = mul(Binormal, matWorldInv).xyz;
	OutWorldPos = PosWorld;
	//
	
	#ifdef DYNSHADOW
	   //Shadowmapping
		float4 ShadowMapSamplingPos = mul(mul(InPos,matWorld), mul(matEffect3,matEffect1));
		float4 RealDistance = mul(mul(InPos,matWorld), matEffect3).z/matEffect2[0].w;
		
		OutShadow.x = ShadowMapSamplingPos.x;
		OutShadow.y = ShadowMapSamplingPos.y;
		OutShadow.z = ShadowMapSamplingPos.w;
		OutShadow.w = RealDistance.x;
		//
	#endif
	
	OutColor = fAmbient; // Add ambient and sun light
   #ifdef DOSUN
	for (int i=0; i<8; i++)  // Add 8 dynamic lights
		OutColor += DoLight(PosWorld,OutWorldNormal.xyz,i);
	#else
	for (int i=1; i<8; i++)  // Add 7 dynamic lights
		OutColor += DoLight(PosWorld,OutWorldNormal.xyz,i);
	#endif
	
	
}

float4 terrain_PS(
	uniform int inLM,
	in float4 InColor : COLOR0,
	float2 Tex : TEXCOORD0,
	float4 InLight: TEXCOORD1,
	float3 InViewDir: TEXCOORD2,
	float3 InWorldNormal	: TEXCOORD3,
	float3 InWorldTangent	: TEXCOORD4,
	float3 InWorldBinorm	: TEXCOORD5,
	float3 InWorldPos	: TEXCOORD6,
	in float4 InShadow	: TEXCOORD7
):COLOR0
{
	float4 Color = tex2D(colorSampler, Tex.xy);
	
	float4 colorMask = tex2D(maskSampler, Tex.xy);
	
	float2 Tile = Tex.xy*numTiles;
	Tile = frac(Tile)*(0.5-2*0.004)+0.004;
	
	float4 color = tex2D(colorSampler, Tex.xy);
	
	float4 color1 = tex2D(tileColorSampler, Tile)*colorMask.r;
	float4 color2 = tex2D(tileColorSampler, Tile+float2(0.5, 0.0))*colorMask.g;
	float4 color3 = tex2D(tileColorSampler, Tile+float2(0.0, 0.5))*colorMask.b;
		
	float4 normal1 = tex2D(normSampler, Tile)*colorMask.r;
	float4 normal2 = tex2D(normSampler, Tile+float2(0.5, 0.0))*colorMask.g;
	float4 normal3 = tex2D(normSampler, Tile+float2(0.0, 0.5))*colorMask.b;
		
	float3 Ln = normalize(InLight.xyz);
   float3 Nn = normalize(InWorldNormal);
   float3 Tn = normalize(InWorldTangent);
   float3 Bn = normalize(InWorldBinorm);
   float3 Nb = 0;
   float3 Vn = 0;
   float3 Hn = 0;
   float4 lighting = 0;
	
	float gloss = normal1.a + normal2.a + normal3.a;	
	
	float3 bumpNormal = ((normal1.rgb+normal2.rgb+normal3.rgb));
	//bumpNormal += tex2D(globalNormSampler, Tex).xyz;
	bumpNormal = lerp(bumpNormal, (tex2D(globalNormSampler, Tex.xy).xyz), 0.5);
	bumpNormal = (bumpNormal-(0.5).xxx)*bumpStr;
	
	//bumpNormal *= 2;
	Nb = Nn + (bumpNormal.x * Tn + bumpNormal.y * Bn);
   Nb = normalize(Nb);
   Vn = normalize(InViewDir);
   Hn = normalize(Vn + Ln);
   lighting = lit(dot(Ln,Nb),dot(Hn,Nb),10);
   
   
   
   
   #ifdef DYNSHADOW
	   float2 ProjectedTexCoords;
	   ProjectedTexCoords[0] = InShadow.x/InShadow.z/2.0f +0.5f;
	   ProjectedTexCoords[1] = -InShadow.y/InShadow.z/2.0f +0.5f;
	
		float blurStr = matEffect2[1].x;
		float shadowDepth = tex2D(ShadowMapSampler, ProjectedTexCoords).x;
		
		float shadow1 = doVSM(float2(shadowDepth,shadowDepth*shadowDepth),InShadow.w);
	   shadow1 = (1-shadow1);
	   
	   shadow1 *=(1-tex2D(ShadowAlphaSampler, ProjectedTexCoords));
	   shadow1 += tex2D(ShadowAlphaSampler, ProjectedTexCoords);
	   //shadow1 *= lighting.y;
	   shadow1 = clamp(shadow1,0,1);
   #else
   	float shadow1 = 1;
   #endif
   lighting.y *= shadow1;
   
   
   #ifdef VELVETY
   	float velvety1 = clamp(velvStr-dot(Vn,Nb),0,1);
   #else
   	float velvety1 = 0;
   #endif
   
   
   
	Color.rgb = saturate(clamp(lighting.y, shadowAlpha, 1)*vecSunColor*2)+(InColor.rgb);
	
	Color.rgb *= lerp(color, (color1+color2+color3), 0.5);
	Color.rgb += (lighting.z+velvety1)*specStr*gloss*Color.rgb;
	Color.rgb = clamp(Color.rgb, 0, 1);
	//Color.rgb *= clamp(colorMask.a,texShadowAlpha,1);
	if(inLM == 0)	Color.rgb *= clamp(colorMask.a,texShadowAlpha,1);
	else Color.rgb *= tex2D(lightmapSampler,Tex.xy).rgb;
	
	Color.a = 1;
	
	return float4(Color.rgb,1);
}

technique terrain
{
	pass p0
	{
		//cullmode = none;
		//zwriteenable = true;
		//alphablendenable = true;
		VertexShader = compile vs_2_0 terrain_VS();
		PixelShader = compile ps_2_a terrain_PS(int(0));
	}
}

technique terrain_lm
{
	pass p0
	{
		//cullmode = none;
		//zwriteenable = true;
		//alphablendenable = true;
		VertexShader = compile vs_2_0 terrain_VS();
		PixelShader = compile ps_2_a terrain_PS(int(1));
	}
}


Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 RELEASED - 04/13/10 21:24

Originally Posted By: BoH_Havoc
PietroNifosi: Also chances are high you won't need static shadowmaps anymore with the upcoming version... wink



You mean you have nice looking shadows o.O.
CANT WAIT now, you shouldnt have mentioned this...now i am unpatient XD.

Keep on the good work, iam a 100% shader noob and need those things^^


Greets
Rackscha
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/13/10 22:39

BoH_Havoc: I'm still modeling architectures, I'm gonna need a few more of those before assembling a city/town. The idea is to have the scenario on 3dsmax, do a render to texture from there once again and print the shadowmap for the terrain as well. I'm glad you like my pictures. If you want I can show you more of what I've done with shade-c and my models so far, you can reach me at MSN pietronifosi@libero.it

Rackscha: Those shadows have been rendered to texture with mental ray.
Posted By: BoH_Havoc

Shade-C EVO Radiosity - 04/14/10 02:12

Rackscha: Well yes, dynamic shadowmapping from the sun is implemented (and has been optimized a lot since the last release). But i'm more thinking about interactive radiosity... grin



Notice the soft selfshadows and caustics laugh
Currently it's for static geometry "only". So an actor moving about terrain/ground won't be affected. But for everything else this is kinda neat and makes dynamic relighting of the scene a piece of cake.

Oh i so can't wait to see what you guys will do with this once it's released laugh

Hope you like it!
Posted By: HeelX

Re: Shade-C EVO Radiosity - 04/14/10 10:48

Uh, wow! Do you think this radiosity thing might be enabled in the future for rotating and moving entities as well? This looks like I could use it for the next release of a7titude!
Posted By: darkinferno

Re: Shade-C EVO Radiosity - 04/14/10 20:10

i never did like the whole quad textures thing for that terrain, i rememeber that it had to be DDS or something or maybe am wrong?
Posted By: NeoNeper

Re: Shade-C EVO Radiosity - 04/15/10 20:07

ohh tnkx havoc. its workkk..
tnkx very much (^.^)
Posted By: oriongu

Re: Shade-C EVO Radiosity - 04/19/10 19:02

Hello,

First of all, thanks for your great work on ShadeC.

I have a problem on the water shader.

link : http://www.orion3d.fr/projet/meetrikk_water.jpg

The reflection on my avatar dosnt reflect correctly on the water.

Do you have any idea why?

Thanks,
Regards,
Orion
Posted By: Hummel

Re: Shade-C EVO Radiosity - 04/19/10 22:41

because your avater is not clipped by the waterplane when it is rendered from the relection view. There must be a material you have to add to them.
Posted By: oriongu

Re: Shade-C EVO Radiosity - 04/20/10 17:25

Hello,

It's not very clear for me. My avatar must have a specific material?
Posted By: Rackscha

Re: Shade-C EVO Radiosity - 04/20/10 17:46

STUNNING o.o, just amazing.
Hope you'll ad dynamic shadows for dynamic lights too laugh

Wow we'll see great projects with it(i think).

Kepp on^^

greets
Rackscha
Posted By: Hummel

Re: Shade-C EVO Radiosity - 04/20/10 18:16

@oriongu:I dont know how Shade-C handles that but normaly yes
Posted By: Rasch

Re: Shade-C v0.91 BETA S1 RELEASED - 04/20/10 19:38

God damit i can´t find it. How the hell can i use the Dynamic Softshadows for the Sun? ^^
Posted By: Vinous_Beret

Re: Shade-C v0.91 BETA S1 RELEASED - 04/21/10 20:24

Its amazing contribution,thanks alot BOH_HAVOC for this
but i have some comments:
1-the shadows are great but it seems to be as slow as A7's blurred stencil shadows.
2-shadows are not clipped by walls,just like stencil shadows.
3-the HDR can't be disabled,unlike every thing else.
but other than that its great plugin,Thank you again man.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 04/22/10 15:39

helloo simple test with night (^.^)






Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/22/10 16:48

WOW where did you get those skyboxes? or skydomes?
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 04/22/10 17:17

Ohhh yee.. Sky_BOX...
heve in free Recources ...
http://au.conitec.net/
at link "textures" (^.^)
Posted By: Widi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/22/10 17:40

This Shaders looks so good at your level (also the sky_box wink ). I think i have to include shade-C to my project too.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 04/22/10 17:58

i am waiting anxious for the new version that havoc this making.
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 RELEASED - 04/22/10 22:28

I hope you shadows will look like this(in later versions :P).

Lowered the shadowviewsize from 2000 to 200 and git this nice shadow.



Sadly they are fading out very early(cause its just 200? thought the clipping parameter would adjust it, maybe you can explain it to me, a total shader noob)



EDIT: And Am i wrong or do the Cones in the night pictures reflect the world in realtime?(or did you use a preredered cubemap? Currently no overwiev of current features)

Greets
Rackscha
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/25/10 00:38

Hey Havoc, I was thinking.. how come you haven't added PARALLAX mapping too for the mdls?
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 05/06/10 14:43

Can you please explain me what this crappy lighting is all about whenever I switch on DOSUN? I'm really confused here grin


Click to enlarge: http://www.themasquerade-guild.com/dosunproblem.jpg
Posted By: Hummel

Re: Shade-C v0.91 BETA S1 RELEASED - 05/06/10 17:43

this has actually nothing to do with ShadeC, but with normal interpolation.
Slin has an article about that on his blog, search for it wink
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 05/06/10 18:55

Ah nevermind I know exactly what you mean. I should have played more with triangulating my normals. But I honestly can't bother arse to re-edit a whole construction set only because I decided to extrude a window or door rather then model them singularly and add them as elements.

Actually this could have been the problem.
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=322497&#Post322497

Since whatever is imported on mdl loses smoothing groups and only just 1 big smoothing group is created, those artefacts are generated. I tried detaching faces to fix it.. but in the end the shade-c shader even makes it worse then my previous screenshot.

I can only think of a solution which is adding dynamic lights here and there to HIDE those artefacts.

But the dyn lights in shade-c 0.91 beta s1 don't seem to work. Very strange!
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 05/08/10 10:59

Alright I did some new testing today, I stopped using the 0.91 beta and downgraded to the 0.90. The dyn lights started to work again, strangeeeee..

Also the normal interpolations were acting differently so Shade-C does affect this issue somehow!
Posted By: Hummel

Re: Shade-C v0.91 BETA S1 RELEASED - 05/08/10 14:05

you have to prepare your mdoel topology to get rid of this issue,
you didn´t read Slin´s article about that I guess...
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 05/08/10 16:16

I'm telling you it's due to the fact about smoothing groups that are lost when the mesh is exported and imported as mdl. the mdl doesn't have smoothing groups.. so the whole mesh becomes 1 entire smoothing group. therefore those artefacts are born.

There was a solution to this, by detaching faces (opening your mesh), but it doesn't fix the problem when shade-c is applied.. actually makes it worse.

Typical of Gamestudio basically.

This is how complicated a task would be normally <-->

This is how complicated it becomes when in relation with gamestudio <-------------------------------------------------->

I'm used to it.

Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 05/10/10 15:37

new screens (^.^)




Hey havoc. Plz brother..
I am not obtaining to use sc_ppAdd()..
I wanted to use the effect Refracts in the current scene..
(T.T)
You can helpme?
Posted By: WickWoody

Re: Shade-C v0.91 BETA S1 - 05/13/10 20:37

Woaw! I must be try it!
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 05/13/10 22:40

so when is this new stable release happening?
Posted By: Scifi

Re: Shade-C v0.91 BETA S1 - 05/16/10 09:17

Help! I can't combine ShadeC with Intense X Copper !
Anybody know how to solve ? Please...
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 - 05/18/10 13:49

lol ^^ I am using the verção shade-c_v0.91_BETA_S1 I am waiting anxious for the new verção of havoc
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 - 05/18/10 13:52

i no use intense-x brother.
Unhappyly I do not know I eat to arrange. I believe to seen in some topic something on skills it intense-X and it shadec. Something referring the error bugs because both used same skill. 99 and 100.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 05/18/10 14:20

Started working on the manual today. Once it's finished, the current version will be sent out to picked beta testers.

Shade-C uses skill99, so does intense-x. So you have shade-c's skill to something else. If you need more info on this, ask the user "overseer". As far as i know, he successfully combined shade-c and intense-x.
This bug has been fixed in the current version. You can simply define another skill which shade-c should use and that's it.

In the meantime, i implemented soft sprites and ellipsoid local volumetric fog. Funnily, the soft sprites are rendered up to 2 times faster than with the A7 standardt material.

This uses only 3 sprites. Note how there are no hard edges where the sprites intersect with other objects




Volumetric Fog


Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 05/18/10 19:00

Havoc 2 things about this video:

http://www.youtube.com/user/BoHHavoc#p/u/4/wP38kwNTwsM

Did you place your grass manually 1 by 1?

And what shader did you use for animating grass and tree leaves? mine makes the items become sort of UNLIT so the lighting fucks up.
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 - 05/18/10 20:34

Wow, the smoke looks really professional now o.o.
One sentecne that might describe shade-c(if you know this sentence wink ):

ITS OVER 9000!!!


GReets
Rackscha
Posted By: Scifi

Re: Shade-C v0.91 BETA S1 - 05/19/10 03:25

Now Intense Illusions should provide a patch for Intense-X Copper to fix this error.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 - 05/20/10 14:20

Hello havoc. One doubts brother.
have some form to make the dynamic light bulbs to emit shadow of objects?
equal rayTrace-Shadow...?
I tried to adapt an example that I have here but I still did not obtain sucess lol
Screen shot of the example without shade-c.


I tried to include the effect in the archive "myshader.fx". So far I obtained to include the rays of the light but it this not generating the shadow of the object
Posted By: BastovBros

Re: Shade-C v0.91 BETA S1 - 05/21/10 09:34

Could anybody tell me why the multitex terrain shader might not work? I tried to make it work, but the tiled textures do not apply to the mask. The whole terrain is covered with the grass tile texture (the first quadrant of the texture image), I guess it corresponds to the red color on the mask. However the mask has also very distinct green and blue areas, but the tiles do not work.....help please...
Posted By: Vinous_Beret

Re: Shade-C v0.91 BETA S1 - 05/21/10 17:15

look's great man thanx alot for you'r effort,
amzing work....
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 05/22/10 14:10

Here Havoc, you wanted to see both baked shadowmaps on meshes and terrain, there you go!

Click to enlarge: link broken

Click to enlarge: link broken

Click to enlarge: link broken
Posted By: Quad

Re: Shade-C v0.91 BETA S1 - 05/22/10 14:15

that scene looks nice,
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 - 05/23/10 18:41

Wow Pietro, now that looks really professional o.o


Greets
Rackscha
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 05/24/10 00:43

Thank you, and sorry..

yesterday I was in a hurry so I made a few quick GS screenshots pressing F6, they came out small and of bad quality.

Here is some more I made today using printscreen and than pasting on photoshop.



Click to enlarge: http://img94.imageshack.us/img94/8453/newshot2.jpg



Click to enlarge: http://img444.imageshack.us/img444/7954/newshot3.jpg



Click to enlarge: http://img541.imageshack.us/img541/5631/newshot4.jpg



Click to enlarge: http://img139.imageshack.us/img139/5747/newshot5.jpg



Click to enlarge: http://img80.imageshack.us/img80/1350/newshot0.jpg
And the baked shadowmaps: http://img80.imageshack.us/img80/1350/newshot1.jpg (Ambient Occlusion + Shadowmap + Lightmap)

NOTE: There is no dynamic lighting and normal mapping shown in these screenshots because I just can't get the dynlights to work with 0.91 beta. And I don't want to switch DOSUN on due to the following issue http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=317928#Post317928
So the colors might look a bit dull right now, but hey it's a huge work in progress!

I'm aiming to obviously develop a videogame, but first thing first:
1. I'm taking my time taking care of details, it has to look as close as the Crysis maps quality as possible! ( and I have to thank Shade-C that is making it happen laugh )
2. I wanna do it in GameStudio, I really wanna push this engine to its limits! ( and prove that it can be done with spending less then 200 euros tongue basically just the commercial license)
3. Prove to my previous lead artist (in Naples - Italy) what it is to have lost me to his unfriendly attitudes ( grin )
4. Prove to CD-Project Red that made me go to Poland with the promise of a job and than suddenly ignored me and left me unemployed what his entire arts team has developed on the title The Witcher compared to the arts I'm developing alone ( grin )

Posted By: alibaba

Re: Shade-C v0.91 BETA S1 - 05/24/10 09:11

Hey Pietro,
Your scenes look really good! It looks really professional. Reminds me somehow to Assassins Creed grin

I have a question:
with which program and how do you bake the shadows?
because they look so awesome!
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 05/25/10 01:01

It's quite irrelevant what program you are using, but anyway I'm a 3dsmax user and those shadows (the ambient occlusion mostly) is rendered using the mental ray plugin.
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 - 05/25/10 10:21

ah cool, thanks. I will try the Demo
Posted By: DavideG

Re: Shade-C v0.91 BETA S1 - 05/25/10 13:31

Hi Pietro! ( We are only italians in this forum laugh ) There is an error in the lights... There are 2 sun with respective shadows...

WHITE CIRCLE = Sun 1 ( with it shadow )
YELLOW CIRCLE = Sun 2 ( with it shadow )
GREEN CIRCLE = evident errors of 2 direction lights



Bye bye! wink
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 05/25/10 15:04

Ciao Davide,
Congratulations for your accurate eye! But you are mistaken as there are no errors at all laugh


Click to enlarge: http://img185.imageshack.us/img185/1268/thesukagods.jpg

In truth there are exactly two suns placed in that scenario. And 3 moons if you really must know. I did that intentionally because they are divinities.. gods, that will affect the player's karma in different ways according to certain days and certain hours of each day.

And besides, these images haven't been posted on the Projects forum, it's a topic in Third Party Tools. Therefore the images aren't exactly open for criticism just yet laugh
I made a promise to Havoc that I would show him baked matching shadowmaps (stencils) through meshes and terrain and I did that.


---

Traduco anche in Italiano avendo notato che hai molte difficolta' con l'inglese:

Non ci sono errori. In verita' ci sono esattamente due soli piazzati in quello scenario. E tre lune se proprio lo devi sapere. L'ho fatto intenzionalmente perche' sono delle divinita', che influenzeranno il karma del giocatore in maniera diversa in base ai giorni e alle ore.

E a prescindere da tutto questo, le immagini non sono state mostrate nella pagina dei progetti, ma in un topic di Third Party Tools. Da cio' si intende che quello che vedi non e' ancora pronto per la critica laugh
Ho fatto una promessa ad Havoc che gli avrei mostrato baked shadowmap (stencils) tra mesh e terreno e l'ho fatto.

Bye bye! wink


Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 05/31/10 17:01

Sorry my website hosting expired a few days ago so I re-uploaded my arts at page 22 and 23 on imageshack laugh
Posted By: DavideG

Re: Shade-C v0.91 BETA S1 - 06/01/10 07:19

Ciao Pietro... Il mio era un semplice avviso avente lo scopo di informarti dell' "anomalia". Adesso capisco il motivo delle 2 luci direzionali...

Prenderò al più presto possibile lezioni di inglese laugh
Ciao ciao!
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 06/02/10 03:23

Hey there folks, I'm trying to model some foliage trees using SpeedTree Modeler 5.0. The trees look great in within the program but as soon as I export them to GameStudio with the differen lighting, shading and all .. they lose quality.
The real problem is that I can't have leaves that rotate towards the camera like if they were sprites and placing leaf sprites manually is quite a pain and a waste of time.
Also the alpha maps look less accurate for some reason.
Anyway I'm forced to keep static leaves in within the same mesh with the bark you know.
I'm modeling in a way so that I can hide those hard edges like in loopix trees (with all due respect of course I've used loopix's goodies in the past) while trying to keep them flow naturally.

Though work but I like the challenge.
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 06/02/10 03:56

the baked lightmap scene you did? its just one model correct? isnt that a huge hit on fps since it defeats the scene management? if it is one model, is that what you plan for your project or just you did it like that just for the test?
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 06/03/10 14:58

@darkinferno No it's not just one model. Shadowmaps for each mesh are individually rendered-to-texture. And no it doesn't eat framerate, at the contrary it's done to speed it up.

This is a sample of the second uv set of each mesh rendered ( simple ambient occlusion laugh ) :

Click to enlarge: http://img688.imageshack.us/img688/394/newao.jpg

Don't pay attention to the framerate here, I was running my laptop on batteries, when I plugged it in the framerate went up x3



By the way I've been playing with the trees and this is what I got so far ( grin ) :


Click to enlarge: http://img72.imageshack.us/img72/6387/aunnaloviuauonnafrikken.jpg
VERY IMPORTANT in wireframe: http://img241.imageshack.us/img241/962/uairless.jpg

Once again, colours might look dull just yet, there is no dynlighting nor hdrl on as I'm waiting for the new version of shade-c to fix it. frown

Also the terrain looks a bit too flat for my tastes, I'm probably gonna download EarthSculptor or something like that and see what I can pull out. laugh
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 - 06/09/10 19:49

Did you import your mesh from max to wed with fbx?

And how do you handle soft/hard edges?

Greets
Rackscha
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 06/10/10 01:15

I export them in .ase
I've recently noticed that the fbx format exports the smoothing groups as well which is good but unfortunately useless when I'm to import a second uv channel.
Let me explain:
When I export a mesh to game studio I export a part 1 which is formed by mesh + textures, and a part 2.
I use the part 2 to extract the second uv set with baked shadowmap.

If I use the ase format everything works fine.

If I use the fbx format it doesn't because it re-arranges the vertexes index differently or whatever, anyway it doesn't work.

As for the soft hard edges what do you mean? antialiasing?
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 - 06/10/10 14:58

No, i mean Normal interpolation as used for MDl models(cylinder as Model looks smooth while the same cylinder looks blocky as Wed Block).

EDIT: oh juts noticed that Shade-c is capable of using the second UV-set for shadowmaps. This way i might use only models and no level geometry imports.


Posted By: Vinous_Beret

Re: Shade-C v0.91 BETA S1 - 06/10/10 15:59

Quote:
No, i mean Normal interpolation as used for MDl models(cylinder as Model looks smooth while the same cylinder looks blocky as Wed Block).

well,you can try using "smooth" flag in WED,
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 - 06/10/10 16:04

As for normal interpolation you have to be able to export smoothing groups, for that the fbx format works decently. The ase format instead doesn't export smoothing groups at all and turns the whole mesh into a 1 big smoothing group.

But it's not that easy to get the desired results anyway, you wanna keep your geometry as much simple as possible, and keep an eye on your triangulations flow.

Infact this is exactly why you're not seeing me posting any new screenshots, I had to start from nearly the beginning, remodifing all my meshes and re-exporting them all.

For example if I had to apply a window to a house, I wouldn't extrude it internally cutting through the wall adding polygons, but I would create it externally as another detached mesh and placed it close the wall.
That way your wall is a quad.


Click to enlarge: http://img714.imageshack.us/img714/1843/thequadthing.jpg

Do you get it?
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 - 06/10/10 16:46

year i get it laugh

Well as long as i dont need stencil shadows, i might use the cutedge modifier from blender to cut the faces for sft and hard edges.

As far as i know, this technique (open mesh) broke the envmaping shader of gstudio, might retry it with shade-c.

If that works and doent have any side effects(okay no stencil but i can live with it^^) like bad colision for polycollision.

EDIT: We finally need proper smothing group support laugh
Posted By: draculaFactory

Re: Shade-C v0.91 BETA S1 - 06/12/10 05:48

Hey, quick question: can you use dynamic lights on terrains with shade-c? Sun light works great, but what about regular dynamic light emitted from entities?
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 - 06/12/10 10:44

No problem.
Works great(tested with normalmapping).

Only the sun works for dyn shadows, thats all atm wink
Posted By: Liamissimo

Re: Shade-C v0.91 BETA S1 - 06/30/10 16:19

If I just include the things as written in the manual and then enter sc_setup(); everything in my game is very bright. just a normal project, i ahve an x1400 mobility radeon, very strange...
Posted By: Nowherebrain

Re: Shade-C v0.91 BETA S1 - 09/09/10 23:48

I'm not trying to "unnecessarily" bump this, BUT....are you still working on this???
-Just (desperate) curious.
Posted By: Ganderoleg

Re: Shade-C v0.91 BETA S1 - 09/10/10 11:35

Sorry, just a small digression..

@PietroNifosi
You could try exporting your model in FBX format (with smooth groups arranged the way you want them) & then do Atlas Mapping in MED, so that you get second skin UV map directly from the game file. Check out my shadowmapping example if you have time:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=341024#Post341024
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 09/10/10 12:59

Hi,

yes i'm still working on it and there's a lot going on behind the scenes. laugh

I'm currently finishing up ssao (not the one HeelX posted, the algorythm i use is ~4x faster and more accurate) and dynamic global illumination and then plan to implement hybrid deferred lighting. I also started work on shadows for dynamic lights and there's a camera motion blur effect now as well as other new effects (don't have the list at hand right now as i'm at work, but there's lots of new stuff). All effects now also work with splitscreen/multi-view games (except for shadows).

I recently bought the sci-fi corridor pack from dexsoft as well as the sci-fi soldier, so i'll post some screens with these assets once the deferred lighting is finished.
I might post some ssao+gi screens before once i'm satisfied with the looks.

Sorry for the long delay, but i want the next release to be as stable as possible with as much effects as possible and as easy to use as possible laugh

In short: I want the next release to kick ass wink
Posted By: Machinery_Frank

Re: Shade-C v0.91 BETA S1 - 09/10/10 13:31

Originally Posted By: BoH_Havoc
I recently bought the sci-fi corridor pack from dexsoft as well as the sci-fi soldier, so i'll post some screens with these assets once the deferred lighting is finished.


Please let me know when you need any help with this, e.g. some special cuts for better smoothing. All these meshes are closed to work with stencils but they could look too smooth in Gamestudio. When you dont need stencils then we can split vertices on some edges to improve the visuals.
Posted By: Ganderoleg

Re: Shade-C v0.91 BETA S1 - 09/10/10 16:09

This is great news smile
Will there also be some updates to my favorite module, HDR?
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 - 10/25/10 19:47

Hellooo brothers..
The havoc did Abandoned the OpenSource Project of the Shade-C?
Posted By: 3run

Re: Shade-C v0.91 BETA S1 - 10/25/10 19:58

Is there any news? I hope project isn't dead frown
Posted By: Germanunkol

Re: Shade-C v0.91 BETA S1 - 10/26/10 19:51

It's not. He's working on it. Quite actively in the past few days from what I gathered. laugh
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 10/26/10 19:55

seconded [is tht a word? lol]

anyways he's still on it actually, did some very useful stuff, the only problem is WHEN it'll be released..

however, am sure games from this community will never look the same once he gets it out wink
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 - 10/26/10 20:54

As mentioned, still working on it and finally getting somewhere laugh

->



Posted By: 3run

Re: Shade-C v0.91 BETA S1 - 10/26/10 20:59

Damn laugh This screens look so cool and real!!!
I'm gonna buy a commercial version of GS, to use this in my project grin
Posted By: maslone1

Re: Shade-C v0.91 BETA S1 - 10/26/10 21:21

That ROCKS!
The shaders in the second pic would be great for my spacegame!

What is your plan / your goal? Do you keep this for free??
If YES, you can be shure, i am gonna donate after using shade-c!

I wish you the best!

regards!
Marcel
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 10/26/10 21:21

and keep in mind the thing that makes shadeC great... its NOT slow... wink you only start noticing fps loss when you turn on alot of shaders but other than that, its one of[if not the] fastest shader system i've seen with GS
Posted By: maslone1

Re: Shade-C v0.91 BETA S1 - 10/27/10 21:02

Well its slow on my pc-system
But i'll buy a new pc with a lot more cpu power laugh laugh laugh
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 - 10/29/10 08:41

note we're talking about the new shadeC, i dont know what version you have wink
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 - 10/29/10 11:21

Hellooo my idolll Havoc. When you go to postar the Updates of the Project here for the staff? I am anxious for the new Version.
Ohh
In the new version you go to include the SSAO? Therefore in the current one I do not obtain to use, I believe that it is not implemented
Posted By: Nidhogg

Re: Shade-C v0.91 BETA S1 - 10/29/10 15:05

Dang those screens look great, Can't wait for the new release.

Terrific work Boh_Havoc.
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 - 10/30/10 17:48

GReat progress.
And yes, Shade-C will change GS.
Cant wait grin
Posted By: Liamissimo

Re: Shade-C v0.91 BETA S1 RELEASED - 10/31/10 17:42

When I try to compile it gives me:
Error in "shade-c/sc_shadows.c" line 55
D3DXMatrixOrthoLH" undeclared identifier

=/
Posted By: William

Re: Shade-C v0.91 BETA S1 RELEASED - 11/01/10 06:48

Looks amazing, glad to see you are progressing on this! Definitely a very stable and expansive shader library. laugh
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 11/13/10 17:16

oh by the way havoc, the package as it is now.. does it offer compatibility to A8?
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 11/13/10 21:51

am about 90% cent sure it does... he'll have to clear up that other 10% ^^
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/01/10 16:13

I have one question guys, how can I make it work with FOG?
Cause when I use 'fog_color = 4' and define custom fog color shadows disappear...
And how can I disable shadows for model? Cause when I turn on shadows, every model has shadow...
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 12/13/10 13:30

Sorry for the late reply, i was "busy" with real life the last few weeks.
Funnily (does that word even exist?) though the last month was good for shade-c. I had a lot of spare time due to certain circumstances and optimized the whole thing.
Now everything except shadows work with simple argb 8bit rendertargets. Inferred Lighting, SSAO, SSGI, DOF, you name it, they all work flawlessly. Shadows will also be ported, i was just to lazy.
Also MRTs are no longer needed at all.
So in theory, if you want to use everything shade-c has to offer, you now only need a ps 2.0 gfx card and it'll run (except for ssao, which needs ps 2.a/3.0 depending on quality settings). I could even port the whole lighting part to directx 8 / ps 1.0 i guess, but that most likely wont happen anytime soon (if at all).


The current version works well with fog. The one available to the public doesn't, I'm sorry.

I have no idea if shade-c works with A8, as i don't have it and don't have money left to buy it. So while i really would like shade-c to work with A8, i can't do anything about it. According to some betatesters the last beta was working fine under A8 though.

A new version will be sent out to betatesters before 2011. If i have time left, there will also be a demo for everyone to play around with, but don't count on it.
If there will be no demo, you can always give CSiS a go, which always has the latest stable version of shade-c implemented.
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 01/10/11 21:23

Hey Havoc, what's your status? laugh
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 01/10/11 22:39

Hey PietroNifosi

I'm currently wrapping everything up for our inhouse game CSiS and am also finishing spotlight shadows for a client (complete with camera<->light/shadowmap culling, yay! laugh ).

Once i'm finished with getting everything to work with CSiS and there are no major bugs, i'll send out a new beta laugh




Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 01/11/11 01:39

Alright! Dude, can't wait to see how shade-c shaders will improve my wastewalkers here!


Posted By: BoH_Havoc

Shade-C Demo - 02/01/11 16:24

Hi,
I put together a SMALL scene, to test the new lighting system, shadows and ssao. Please give it a try if you have the time laugh

http://shadec.project-havoc.com/downloads/demo.rar



Please let me know if there are any bugs or visual glitches. laugh

If there are no major bugs in the demo, i'll send out a new version to testers and clients next week.

[edit] Please note that this demo requires pixelshader 2.a, due to high quality ssao. There is a low quality ssao which only needs ps 2.0 though, but doesn't look as good (obviously). I'll put together another demo which lets the user decide about ssao.
Posted By: 3run

Re: Shade-C Demo - 02/01/11 16:35

Looks great so far. I only don't like the way shadows are smoothed. In all other ways its just perfect.
Posted By: the_clown

Re: Shade-C Demo - 02/01/11 16:52

Really cool, I like the shadows.
Just a question, I saw a light with a cookie if thats the right word? Hows that gonna be managed, can we assign the cookie bitmap in WED or the lights action or will we have to do some deeper coding for that?
Posted By: Quad

Re: Shade-C Demo - 02/01/11 16:54

insta crash on gt425m, drivers are the default ones that come with the laptop i am going to update and try again.
Posted By: TheShooter

Re: Shade-C v0.91 BETA S1 - 02/01/11 17:21

this looks all so great. But how can I apply the godrayses to 1 or more lights??

grin

vG
Posted By: Superku

Re: Shade-C v0.91 BETA S1 - 02/01/11 17:56

Looks very nice, I like the moving and rotating light(cube) very much.
Posted By: TerraSame

Re: Shade-C Demo - 02/01/11 21:41

Runs nicely (136 fps) on my old Sony Vios Desktop
2 Gig ram - Windows XP - Pentium(R)D - 3.00 GHz - NVIDIA GeForce 9800 GTX (Up-Dated Video Card)
Question: Will that work with my huge levels or will that be a frame rate killer?
Posted By: rojart

Re: Shade-C Demo - 02/01/11 23:41

Hi,
With my GeForce GTX 465 I can see on the shadows & ssao some grain artifacts, but the rest looks just fantastic!

ps
don't forget me to the beta testing.
Posted By: lostclimate

Re: Shade-C Demo - 02/02/11 00:01

I get a creash that says something about not being able to load mtlDefaultBlock or something like that, then a level loads, then it crashes.
Posted By: PietroNifosi

Re: Shade-C Demo - 02/02/11 00:33

Unfortunately all I get is a bunch of messages which are all the same "can't compile effect ... bla bla bla", in the end I display a scene with a flame effect which looks pretty decent and the rest of the objects with no shader applied.
My current graphic card is an ATI Mobility Radeon HD 5470.
Posted By: bk9iq

Re: Shade-C Demo - 02/02/11 03:24

Works with Frame Rate of 200+ on my GTX 260 Mobile
Everything is AWESOME ....

Posted By: TerraSame

Re: Shade-C Demo - 02/02/11 05:00

Rojart... how did you zoom in so close?
I couldn't figure out how to move or zoom jut pan...
Posted By: Quad

Re: Shade-C Demo - 02/02/11 08:13

use arrow keys
Posted By: rojart

Re: Shade-C Demo - 02/02/11 08:58

Originally Posted By: TerraSame
Rojart... how did you zoom in so close?
I couldn't figure out how to move or zoom jut pan...

Yes, with cursor keys, as Quadraxas already said.

But when unable to move, another way is to go into the debug mode:
[SHIFT] + [F11]
[0]
... and now you can use the [W],[S],[A],[D] also.
Posted By: 3run

Re: Shade-C Demo - 02/02/11 10:20

I have same shadows as rojart. I really don't like them.
Posted By: HeelX

Re: Shade-C Demo - 02/02/11 15:40

I have 33 fps and I am disappointed about the dynamic shadows. Why don't you blur them? I saw this jitterish salt also in GTA4 and it just looks silly (I don't blame you, I just wonder why you didn't blurred it because it is obvious that it is striking).

Could you please add a hotkey to toggle SSAO? Since I am working on the same topic, I would like to look into it a bit more what works for you and what not.
Posted By: painkiller

Re: Shade-C Demo - 02/02/11 16:37

I get 110 fps at 720x480 in my HD3650
Posted By: TheShooter

Re: Shade-C Demo - 02/02/11 17:42

I get 512 fps at 1920x1080

(My system is below)
Posted By: Machinery_Frank

Re: Shade-C Demo - 02/02/11 18:42

I like it. Everything looks so much better with good lighting and shadows, even when shadows are not perfect, it is a thousand times better than a flat unlit scene.

But I wonder about a different issue: Like with all the other Gamestudio demos I tested, I see this jerky, stuttering camera movement. When I use the mouse to look around then it is not smooth. It does not move evenly. But if you play a commercial game then most of the time the movement is very smooth and evenly distributed. Why is this the case?
Posted By: Hummel

Re: Shade-C Demo - 02/03/11 21:42

You should really add some kind of bilateral pp-filter to blur out the shadows penumbra grain. Also, making the penumbra jittering random for each frame should improve the quality. wink

I´m impressed by your endurance to continue working on ShadeC.
Posted By: PietroNifosi

Re: Shade-C Demo - 02/04/11 19:10

Okie dokei I've updated my directX on windows7.. and it works just fine, frame rate is ok but as the others have suggested, those shadows need to be improved with a blur effect or something.
Posted By: BoH_Havoc

Re: Shade-C Demo - 02/16/11 15:17

(I could swear there was a new post by PietroNifosi...but somehow it vanished. Or did i imagined it oO)

Alright, feature wise the next beta is ready. I'm now updating the manual and then testers get their version. laugh

Some fresh shots:
All lighting is fully dynamic. No lightmaps are used (they are supported though and should be used for performance reasons).
Rightclick and open pictures in new tab for full-res.

Interior, powered by dexsoft stuff wink





My ugly terrain test + funny looking ocean shader. Now supports unlimited textures and normalmaps. I hope unlimited is enough for you darkinferno wink
Performancewise it's a disaster to support unlimited textures though, so use as less textures as possible.




About the performance question:
I can't say for sure, but in most of my tests, fps halfed when using all shade-c effects and a decent amount of lights. So if your game already runs at 60 fps, full useage of shade-c might not be the best option. But again, i haven't tested with a real game, except out inhouse game CSiS, which is a space sim, and therefore quite different from your "regular" 1st/3rd person game with "closed" levels and a solid ground.
Hopefully betatesters will be able to give more info on performance once they integrated the new version into their games. laugh
Posted By: darkinferno

Re: Shade-C Demo - 02/16/11 15:31

YES YES YES MARRY MEEEEE, dude, i swear, my games would NEVER be even CLOSE to being created the way i wanted if it werent for you and i look forward to using your tech PROUDLY to power our games, as a matter of fact Havoc, i should be sending you a beta of my own REAL REAL soon of our third Person shooter and if i get these shaders? grin we're proud of what we have so far and cant wait to implement these, seems we may be able to restart our FPS also since this is what it was waiting on..

loving the water shader, was truly needed, the reason why i sticked to one of your older terrain shaders was because of the global normal mapping, which i loved, idk if you tossed that idea, though i guess if i get the ability to use GS shadow maps then its fine..

what i like about shadeC is that its not just one effect, one great shader cant make a scene look good and a game is a scene. not an object, so its how all shaders, ppfx and mdlFx come together and thats where shadeC stands out

looking forward to testing man

and goodluck with the millions of suggestions or tweaks you'll get from testers[me grin ]

oh, theres also alot of subtle shaders being used in the screenshots that i want to point out, in case most wont notice them, as said, a good scene isnt about how one thing stands out, but how it all works together, so i think am seeing [feel free to correct me havoc]:
- refraction shader at the vents ?
- luminance mapping used for the lights ?
- dynamic lights? dynamic shadows? Ambient Occlusion ?
- environment mapping ? [noticed it on estinguishers]
- velvety effect on character skin ?
- and ofcourse hdr and dof
? am seeing some grains in the walls, i would love to assume its detail mapping but i assume its just a part of the texture right ? grin

one question though, you didnt happen to get your volumetric fog working for shapes other than spheres did you ?


Posted By: PietroNifosi

Re: Shade-C Demo - 02/16/11 16:58

hey havoc, yeah i wanted to edit my last post, write something more specific with a few screenshots, but nevermind now.
Waiting for your PM to get the source codes for us betatesters.
I'm assuming that at this stage of Shade-C i won't be needing this SSAO extra plugin http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=354503&page=1 (shade-c has his own ssao now am i right?)
Posted By: Schmerzmittel

Re: Shade-C Demo - 02/16/11 21:33

Havoc,

is shade-c still for free? I mean with credits or something? I wasn't on the forum for a long time.
Posted By: lostclimate

Re: Shade-C Demo - 02/16/11 23:52

I am sooooo excited for this, you have no idea.
Posted By: Machinery_Frank

Re: Shade-C Demo - 02/17/11 10:03

Hey Boh_Havoc, you made such an amazing level. I would like to show some of your images in our users galery if you dont mind.
Posted By: the_clown

Re: Shade-C Demo - 02/17/11 14:42

Originally Posted By: Schmerzmittel
Havoc,

is shade-c still for free?


I'd like to know that, too. This looks really amazing, are you still going to give it away for free?

Am especially pleased about the realtime lighting stuff.
Posted By: PietroNifosi

Re: Shade-C Demo - 02/17/11 18:32

Ok if i remember correctly it's not going to be a freeware. But considering the efforts that havoc has put into this project, it's definitely worth to buy.
Posted By: 3run

Re: Shade-C Demo - 02/17/11 18:37

I hope it'll be free for free projects.
Posted By: Dark_samurai

Re: Shade-C Demo - 02/17/11 18:58

I would be willing to pay for it if it will be compatible to A8 and has no hardwarerelated problems (which are sadly very common in shader projects...).
Posted By: BoH_Havoc

Re: Shade-C Demo - 02/26/11 22:37

Quote:

oh, theres also alot of subtle shaders being used in the screenshots that i want to point out, in case most wont notice them, as said, a good scene isnt about how one thing stands out, but how it all works together, so i think am seeing [feel free to correct me havoc]:
- refraction shader at the vents ?
- luminance mapping used for the lights ?
- dynamic lights? dynamic shadows? Ambient Occlusion ?
- environment mapping ? [noticed it on estinguishers]
- velvety effect on character skin ?
- and ofcourse hdr and dof
? am seeing some grains in the walls, i would love to assume its detail mapping but i assume its just a part of the texture right ?


Everything correct, except the detail mapping. This is "just" dexsoft texture quality laugh

Quote:
one question though, you didnt happen to get your volumetric fog working for shapes other than spheres did you ?


Nope, not yet. Was mainly working on the lighting pipeline the last few months. There's a new animated soft-sprite-based fog though which works quite nice.

Quote:
I'm assuming that at this stage of Shade-C i won't be needing this SSAO extra plugin http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=354503&page=1 (shade-c has his own ssao now am i right?)


Yes, SSAO is implemented. Using Shade-C's ssao together with HeelX ssao is possible, but not recommended due to performance reasons when it comes to depthmap rendering. I might write a wrapper for HeelX version in the future which removes these issues, but don't count on it.

Quote:
is shade-c still for free? I mean with credits or something? I wasn't on the forum for a long time.


The version available to the public is still and will always be free. Shade-C EVO will have a free version, too, once it's finished, but it won't have all features or will be time limited. Haven't thought about that too much yet. Will do that once Shade-C EVO is v. 1.0 wink

Quote:
Hey Boh_Havoc, you made such an amazing level. I would like to show some of your images in our users galery if you dont mind.


Sure thing! Go ahead! laugh



In other news:
The manual is almost finished. However Germanunkol noticed a memory leak in CSiS (using the newest Shade-C version) which might have something to do with Shade-C. I'll make sure to fix the leak if there is one, and after that the new beta will be ready. I'm guessing 3-6 days (?)
Posted By: Hallucinogen

Re: Shade-C v0.91 BETA S1 RELEASED - 03/06/11 04:53

Had abit of a play around with an old converted Predator model (Definately not for a serious project lol) using the Shade-C Beta. Very impressed.

Without Shade-C (Night scene with grass, few less trees etc etc)


Better Quality Pic 1

With Shade-C (Day scene without grass, more trees and better tracking laser)


Better Quality Pic 2



Better Quality Pic 3
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 03/13/11 18:23

what's up havoc, been a while once again frown
was that leak solved? documentation written?
Posted By: TheShooter

Re: Shade-C v0.91 BETA S1 RELEASED - 03/13/11 21:13

Man, its so awesome wink When will it be released?
Posted By: Fab4

Re: Shade-C v0.91 BETA S1 RELEASED - 03/25/11 18:57

I have a strange problem with normalmapping.

on the left side I get an edge where I set my seam for the UV-mapping. This effekt doesnt appear in shaderview as you can see on the right side. has anyone an idea what is causing the problem, or has anyone else this problem?

i tested it on my pc and notebooke. the effekt is the same, but the systems are totaly different.
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 03/29/11 17:31

Wow! The Shade-C shaders are soo awesome!
You don't know how much help this is for a shader noob like me.
And I'm sure that almost every one that uses shade-c thinks the same.

Here are 2 screenshots of the menu-scene of one of my projects,
At one of them I just disabled shade-c; no other changes!
(that's also for those, who say '3DGS is sh**. You cant get good graphics with it')

Click to reveal..

with shade-c:

joke tongue (that was without shade-c)

with shade-c cool :

Click here for full resolution


You can see, if you've got some awesome shaders, know how to use them and take your time at configuring them the results can be pretty nice. wink

I'm really happy with shade-c (and its free!!), but I have got still some problems with it...

The worst thing is that I can't use Normal-Mapping with Sun and Dynamic lights at the same time. Has anyone an idea why?

I've got also a problem with the water. Thats not the most important thing but it looks so nice and I could really need a watershader like that.
The problem is that the water has got a kind of "zoom" effect when the camera gets nearer to it. What happens is that the refracted picture gets smaller if the camera moves toward it and the pixels at the edge of the refraction are stretched.

You can see it here on the right side:
Click to reveal..




and if I try the "old" water shader (I think it was v0.9) theres already another problem:
Some vertex-points change their z-position for one frame which looks like a grid. it took > 150 screenshots to get this pic:

Click to reveal..




And another little thing.
"...YOU HAVE TO SHOW THE SHADE-C LOGO ON STARTUP."

I already did this when I downloaded shade-c the first time.
But I'm using an edited version of the shade-c logo which fits more to the style of the game.

Do I have to use the original one, or is mine also ok?



sorry for crappy english skills,
Kartoffel smile
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/13/11 21:38

God it's been ages, last time I was told 6-7 days to the next betatesters release, and i've been waiting for more then a month, getting closer to the second month now.

What's up Havoc? I've red from the csis forum that you had a car accident, but that happened before christmas 2010, then I was told you were ok.

So I'm asking if it's still going to be released anytime soon.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 04/20/11 14:07

@ Kartoffel: Yes you can use that logo if you like.
Please send over the water shader you are using (the first one) via pm and i'll fix it ... looks like a wrong texture sampler setup.


I'm really busy with my bachelor thesis, that's why i'm not around that much.
I have implemented 2 new effects though, inferred lighting and mlaa

1.) Inferred Lighting
Lighting is rendered at 1/4 resolution and then upsampled by a DSF Filter. By using inferred lighting i was able to get ~60 fps with 768 lights on screen. Without inferred lighting i get ~3-6 fps. Additionally, simple alpha blending is now possible for the lighting buffer by using stippling. This wasn't possible before. The stippling pattern hasn't been integrated yet, but everything is ready for it. While all this sounds nice, there is a downside to it: projection maps with high detail aren't possible with inferred rendering, as they are only rendered at 1/4 resolution (like the rest). So if you have hd projection maps on your lights, don't use inferred lighting or you will get blurry projections.
Inferred Lighting is used in "Red Faction: Armageddon" which will be released in a few weeks.
More info in inferred lighting here: http://gdcvault.com/play/1014526/Lighting-the-Apocalypse-Rendering-Techniques

2.) MLAA
An anti aliasing shader which works surprisingly well and is faster than MSAA. Additionally it works with deferred/inferred pipelines (MSAA doesn't on dx9 hardware) which is a big "Yay!".
More info in MLAA here: http://www.iryoku.com/mlaa/


A beta has been send out to testers and clients (finally). Please let me know if you didn't get the mail. laugh

Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 04/20/11 14:59

woooo, heading to test now, will be sure to update you and 16 textures are enough, atleast for me, you said ubershader now works for blocks ? does that mean it takes static lighting into account ?

or i still need dynamic lights to light blocks ? i also noticed in last shaders that sunlight seemed to light the entire level even areas behind walls ? i'll see what this new shader does though ...

and thanks man, we've been dying for this xD
Posted By: rojart

Re: Shade-C v0.91 BETA S1 RELEASED - 04/20/11 14:59

I can't believe the MLAA was implemented, thank you very much!

Quote:
After MLAA (Morphological Anti-Aliasing) and SRAA (Subpixel Reconstruction Anti-Aliasing) or more recently FXAA, here is a new anti-aliasing technique introduced by Humus and called GPAA or Geometric Post-process Anti-Aliasing.

In short, GPAA uses geometry information to very accurately smooth geometric edges:

The technique is relatively simple. The scene is initially rendered normally without any antialiasing. Then the backbuffer is copied to a texture and the geometric edges in the scene are drawn in a post-step. The edges are drawn as lines and for each shaded pixel the shader computes what coverage this pixel should have had by the primitive that shaded it. It also checks what side of the line the pixel center is and blends the pixel with a neighbor up or down in case of a mostly horizontal line, or left/right in case of a mostly vertical line.

According to Humus, the main advantage of this technique is performance and quality and the main disadvantage is that you need to have geometric information available.

More information and Direct3D 10 demo download HERE.


ps: I've got it. Now, I've some time to look for bugs. wink
Keep up the good work and thanks again for your TIME!!!
Posted By: Quad

Re: Shade-C v0.91 BETA S1 RELEASED - 04/20/11 23:41

how do i become a client/beta tester? we are starting a project and thinking of using this.
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 RELEASED - 04/21/11 00:29

*wonders the same*
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 04/21/11 06:10

well i guess you become a client if you buy the full shade-c license, and beta-testers i guess where randomly picked...
Posted By: Quad

Re: Shade-C v0.91 BETA S1 RELEASED - 04/21/11 08:11

well how do id *buy* it?
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 04/21/11 12:27

i wouldnt say random, i'd think it would have to be people doing somewhat impressive projects and are more likely to use ALL features of shadeC scion for example uses EVERY shadeC effect, that way i easily can make reports on what works our not ...

i must comment though, unlimited light sources and all these shadows are AMAZING looking
Posted By: Quad

Re: Shade-C v0.91 BETA S1 RELEASED - 04/21/11 12:31

I thought so... i will ask again when i got stuff to show then, there is still a lot of work before adding shaders anyway.
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/21/11 18:23

Ok i'm officially testing it on Wasteland. Needs a lot of twicking before i can show new screenshots hang in there.
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/30/11 18:19

Question for betatesters:
Am I the only one that can't display terrains anymore?
I mean as soon as the new terrain shader is applied, the terrain is no longer rendered (it's invisible).

This is my latest directx installation directx_Jun2010_redist.exe

And my graphic card is an ATI Mobility Radeon HD 5470
Posted By: rojart

Re: Shade-C v0.91 BETA S1 RELEASED - 04/30/11 19:30

Hmm, I've already tested the level demo with Nvidia GPU and I had no problem with terrains.
You use the A7 engine, right?

btw. Happy Birthday!
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 05/01/11 00:29

yes A7 version 7.76
maybe it's a directx version issue? what version should i have installed?

EDIT:
It's strange but after screwing around with the terrain shader I think i fixed it in the end simply changing

VertexShader = compile vs_2_0 mainVS();

to..

VertexShader = compile vs_3_0 mainVS();

Posted By: memoli

Re: Shade-C v0.91 BETA S1 RELEASED - 06/19/11 10:27

hi boh hovoc i want to buy shade-c last version how can &#305; buy your work .how can download and try shade c last version (last beta) whitout buy it thank u
and how much ??
Posted By: Logitek

Re: Shade-C v0.91 BETA S1 RELEASED - 06/30/11 07:51

Quote:
FROM NOW ON, YOU HAVE TO GIVE CREDITS WHEN USING SHADE-C (OR PARTS OF IT) IN ONE OF YOUR PROJECTS.
IF YOU ARE CREATING A (COMMERCIAL) PROJECT/GAME, YOU HAVE TO SHOW THE SHADE-C LOGO ON STARTUP.


Where can I find the logo?
Is it available in 1024 * 768 px?
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 07/02/11 19:12

Hello Havoc!
One time I was away from my work with 3dgs but now I'm back with normal activities.

I'm trying to use the version "Shade-C v0.91 BETA S1" 3dgs in 8.2 but I'm struggling with some bugs.
When I activate the option "sc_smSunSetup (screen_size.x, 2000, 1500, 0.8, 1);" It turns out that the error in the image below.


These errors appears black.
Can you give me a hand?
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 07/02/11 19:28

Shade-C is not supported for A8, this could cause such visual errors.
Posted By: painkiller

Re: Shade-C v0.91 BETA S1 RELEASED - 07/02/11 21:50

what I find really interesting from latest Shade-C demo is real-time shadow mapping in indoor scenes, it would be nice if Conitec improves the PSSM shader to achieve that.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 07/05/11 16:28

Tradução do português para inglês
I am sad to hear that! (T.T)
I'd like to take this opportunity to ask a question that maybe I should do in another topic.

I'm trying to learn how to implement my own shaders in enguine, as did our friend Havoc.
To do this, I am trying to use the sources files that the site be unavailable from Nvidia (CUDA ZONE), http://www.developer.nvidia.com/nvidia-graphics-sdk-11.
But I'm not getting to understand the basic principles to get my implementations.

Someone explain to me where to start?
Posted By: JibbSmart

Re: Shade-C v0.91 BETA S1 RELEASED - 07/05/11 16:34

The GameStudio shader workshop.

Jibb
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 07/06/11 12:36

Yes Jibb.

Surely this is the way lol.
But already started their studies this way, but now I would like to implement something more complex, as deferredShadding, AmbientOclusion, GlobalIlumination among others.

There are these sources shaders Nvidia's website but still do not understand how to use them.
Posted By: JibbSmart

Re: Shade-C v0.91 BETA S1 RELEASED - 07/06/11 14:18

It's always harder to understand someone else's code. I personally find that reading papers is much more helpful to understand how a technique works, and then I can write it my own way. Occasionally I'll look at other people's code if I just can't understand a formula (or its application) from the way it's described in a paper.

An A7oogle search should help you find simpler examples of SSAO (there was a time when many users tried it), and if you look back at the shader contest you'll find other cool examples (I had a deferred lighting example in there which was relatively simple (I think), but it's all out by half a pixel).

Or just start with simpler effects. Deferred shading, SSAO and GI are each very unusual techniques. Valve provides heaps of cool papers on how they did lighting in TF2, HL2, and L4D, so it's worth checking out!

Jibb
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 07/06/11 16:27

Tankx for your attention JIBB (^.^) Lets gooo studyyyyy
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/13/11 16:45

As i'm getting lots of E-Mails and PMs lately:

Shade-C is far from dead. I'm still working on it.
There will be a public release featuring all the new stuff showcased in this thread later this month.

There hasn't been much info from my side in the last weeks and months, due to my bachelorthesis (which is now finished) and coming up masterthesis which needed my full attention.

The next version will also introduce a new licensing model, as a LOT of work has been put into Shade-C and there were almost no donations over the years (thanks again to those who donated!). But basically Shade-C will still be free to try, as it has been all the time. More info on that later.

Also, i'm working hard on putting something together for the Summer Contest to get an upgrade to A8 Pro, as Shade-C EVO still doesn't work with A8 and i can't figure out why as i don't have A8.
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/13/11 17:16

Great News! Finally! laugh
Posted By: PadMalcom

Re: Shade-C v0.91 BETA S1 RELEASED - 09/13/11 18:43

Shame on us not to donate! This project is worth so much for the community. I'm really looking forward to the new version!
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 RELEASED - 09/14/11 06:02

i really really wish i could donate. i cant even afford my pc to be shipped to me though let alone to donate on something right now frown frown frown
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 11/08/11 10:27

Originally Posted By: BoH_Havoc

There will be a public release featuring all the new stuff showcased in this thread later this month.


Will it happen?
Posted By: memoli

Re: Shade-C v0.91 BETA S1 RELEASED - 11/18/11 07:42

hi folks i use shade-c for my project but i need some help. i use aio shader (myShader.fx) on tree models and i want to add leaf animation into myShader fx.
how can i do this
thanks your help laugh
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/08/11 12:41

So? When we'll get public release??
Posted By: Rei_Ayanami

Re: Shade-C v0.91 BETA S1 RELEASED - 12/10/11 16:08

I'd also like to see a with A8 working edition, that would be über-awesome!
(And I would pay for it wink )
Posted By: painkiller

Re: Shade-C v0.91 BETA S1 RELEASED - 12/10/11 16:12

Originally Posted By: Rei_Ayanami
I'd also like to see a with A8 working edition, that would be über-awesome!
(And I would pay for it wink )


with some workarounds you can get 091 Beta S1 fully working on A8 wink
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/10/11 16:19

I got HDR and shadow from 091 beta working on A8 wink
Posted By: JoGa

Re: Shade-C v0.91 BETA S1 RELEASED - 12/10/11 16:57

the water works also? Would be great, if it works in your test - that would follow that its a problem of myself and not of shade-c :-)
It stays black like ... oil or something like this frown


edit: A8 com
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/10/11 17:17

I've never tried water shader from previous shade-c (091 beta doesn't have water shader) with A8 com, I don't have one, only A7 com.
Posted By: Rei_Ayanami

Re: Shade-C v0.91 BETA S1 RELEASED - 12/10/11 17:42

Good to know, going to give it a try.

[Though I need to use another shader, too, and I guess that won't work together]
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/10/11 18:13

It depends what shader you are going to use.
Posted By: Rei_Ayanami

Re: Shade-C v0.91 BETA S1 RELEASED - 12/10/11 18:45

I want to use the earth glass shader from the wiki wink
[Wiki Link]

Actually I'd only need a nice pointlight with dynamic lightrange - "that's all" tongue

(Oh, at this moment I wish I would use Unity D: )
Posted By: JoGa

Re: Shade-C v0.91 BETA S1 RELEASED - 12/27/11 14:16

Does anybody has experience with the shade-c water with A8?
The shore foam is not visible also there is no transparency at the shore and I tinker with the floats, giving in the sc_water.fx, but with no result. The foam is just visible, if the camera is very near - has anybody a idea, tip?
Posted By: JoGa

Re: Shade-C v0.91 BETA S1 RELEASED - 01/06/12 09:10

I have got one little question for the terrain shader:
Is it possible to adjust the scaling of the Quad-Texture-pices (not the picture itself, but the used scaling for tiling on the terrain)?
For example: My quad-textur is 1024x1024 but the tiling of the shader is very compact. So you can see ingame the tiling very well.
Is it possible to adjust this scaling/tiling of this Quad-Texture to cover more of the terrainmesh with one tile?
Posted By: Rondidon

Re: Shade-C v0.91 BETA S1 RELEASED - 01/15/12 05:16

Are you still working on this? laugh

Some new features, optimizations and improvements would be very nice.
Posted By: JoGa

Re: Shade-C v0.91 BETA S1 RELEASED - 01/21/12 13:31

@Rondidon: looks like it isn't supported/used anymore/at the moment :-/
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 03/21/12 13:40

he is...
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 03/21/12 23:33

yes, still working on it ...






Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 03/22/12 02:12

Cant wait to get my hands on this, seems like this is focus alot more on level design than before, which has ALWAYS been our struggle;

Youve really given us a reason to stick with gamestudio man, I hope they know just how valuable you are wink

I assume thats model level correct ? or is it blocks ?
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 03/22/12 03:50

I definitely agree with darkinferno.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 03/22/12 10:09

It's the warehouse demo which was done by crew51, which is all blocks. I just generated some normalmaps for it.

The green stone is a model of course.
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 03/22/12 11:13

cool to hear from you (BoH-Havoc) and Shade-C.
Im a beta-tester, and i really hope for the final release you do not change alot in the setup of the shaders for a model as im already pretty ahead in the project i use shade-c.
Shade-C is a very powerful tool and thanks for it!
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 03/22/12 13:07

Okay, am just wondering if all these lighting techniques work for models also, I know I was in support of blocks earlier but, I guess Ive learnt just how slow they can be..

Again though, looking forward to this
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 03/22/12 19:05

Alright folks, I know it's been a long while but I decided to stop the Wasteland development for now (mostly since I played Skyrim) and decided to switch back to my Medieval Project.
Here is some of my latest development using Shade-C EVO for betatesters (although I received my last update about a year ago).
Therefore I'm expecting some major improvements expecially when it comes to framerate and softshadows.
Also Havoc, I would love if you could add a brightness/contrast/saturation shader to your list.
It would comes really handy for daylight scenarios.
And I sincerely hope you haven't changed too many things around, since that would mean re-ordering / re-balancing every settings frown


By pietronifosi at 2012-03-22


By pietronifosi at 2012-03-22


By pietronifosi at 2012-03-22


By pietronifosi at 2012-03-22


By pietronifosi at 2012-03-22


By pietronifosi at 2012-03-22
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 03/22/12 19:06


By pietronifosi at 2012-03-22


By pietronifosi at 2012-03-22


By pietronifosi at 2012-03-25


By pietronifosi at 2012-04-01

Well enjoy for now and please let me know about the next update through email (hopefully soon laugh )

-Pietro
Posted By: ratchet

Re: Shade-C v0.91 BETA S1 RELEASED - 03/23/12 15:16

since I played Skyrim) and decided to switch back to my Medieval Project.
Let's hope for a great Follout 4 so you'll switch back to the previous great game laugh
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 03/26/12 11:02

Hehe thanks Ratchet, I was expecting you would say that.

Yet I didn't really have a clear layout in my mind for the Wasteland levels, and I didn't want a game played exclusively in desert landscapes.

Moreover this one here is a lot more detailed if you compare the two.

I don't plan to cancel the Wasteland Project though don't worry, I'll just pospone it for the future

-Pietro
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 03/31/12 22:45

Quote:

Im a beta-tester, and i really hope for the final release you do not change alot in the setup of the shaders for a model as im already pretty ahead in the project i use shade-c.


Quote:

And I sincerely hope you haven't changed too many things around, since that would mean re-ordering / re-balancing every settings


I did change stuff around, but only because of performance reasons and more easy useability (i.e. a lot of the sc_skill stuff is gone now and more things can be set directly when defining the material). That's why the beta wasn't/isn't public: Things might change.

All in all it's not much different though, you still setup your effect variables and call sc_setup() (although you can now also pass a settings container to sc_setup and don't use global variables at all. This is needed for multiscreen/view support).
It shouldn't be to much of a hassle to port to the new version.

Quote:

Okay, am just wondering if all these lighting techniques work for models also, I know I was in support of blocks earlier but, I guess Ive learnt just how slow they can be..


Yes, they work with models. Also, you have some more options when using models since you can use more textures (entSkin2 and entSkin4). With models, you could theoretically set 128 different lighting models (blinn-phong, oren-nayar, cartoon, skin, rock, wood, stone, etc) to different parts of a model through a single grayscaletexture (hooray for deferred shading and volumetric texture lookups!)*, have teamcolors, emissive mask, displacement mapping, specular mask, etc. . With blocks, you can also do all that stuff, but not that much at the same time for one block due to texture limitations. I might fix that limitation in the future, but it's not a high priority right now.

* You can literally paint materials on a model. I.e. if you have a tree, you paint the trunk with the "wood" light-model/material and the leaves with the "leaves" light-model/material.
Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 RELEASED - 03/31/12 23:48

@BoH this sounds great(and i hope this is not an aprils fool grin )
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 04/01/12 05:40

awesome, you definately give users a reason to stick around, I look forward to it laugh
Posted By: PadMalcom

Re: Shade-C v0.91 BETA S1 RELEASED - 04/01/12 20:26

@Pietro: Your screenshots are awesome!

@BoH_Havok: Good to see you around again! laugh
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/08/12 19:17

First of all thanks PadMalcom.

Havoc, could you give me a new estimate for the next release?
I've nearly finished this first medieval scenario (town plus surrounding forest) and I have to say the framerate is really bad at this stage since the level is very detailed in terms of polygons and textures size.
Posted By: ratchet

Re: Shade-C v0.91 BETA S1 RELEASED - 04/17/12 21:10

Because you need heavy LOD and some clever occlusion !
Like AAA games do.
Play skyrim and you 'll notcie LOD in :
- models
- shadwos distance and resolution
- textures (mip mapping)
Fable 3, Skyrim, etc ... etc ...

A complex game can't be a simple copy and paste or in this case this is some game with some top down view !

So you have lot of work laugh

Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/19/12 10:38

Hey ratchet, I'm well aware of that, infact that level has already models and textures lods, It's just that gamestudio can't handle the whole thing running.
Shade-C is a very complex set of shaders, and once I add some extra AI and other stuff like waving grass and critters reacting with player (like birds scattering away), the whole thing starts crippling.
Let's face it, I'm really pushing the engine to its limits here.
Also the Shade-C version i'm using atm doesn't really handle alpha channels (transparencies) well.. unless I use hard edges, which is a great downside for the scenario. Therefore my vegetation doesn't look as good as my architectures but instead it flickers in the distance. That's really bad.

Right now I'm studing how to create good looking lastgen forest scenarios, since I'm not satisfied with what I've got atm.

Soon I'll also open a thread showing my Gamestudio REEL 2012.
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 04/23/12 06:30

Originally Posted By: PietroNifosi
...and once I add ... stuff like waving grass ... the whole thing starts crippling.


Shade-C will have a WIND Flag in the Final Version which does waving for grass etc so dont waste precious time and memory with that laugh
Note: The WIND Flag does exist already in the Beta, but it does nothing yet.
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/23/12 14:24

yep i'm aware of that
Posted By: HeelX

Re: Shade-C v0.91 BETA S1 RELEASED - 04/23/12 17:31

Originally Posted By: PietroNifosi
Also the Shade-C version i'm using atm doesn't really handle alpha channels (transparencies) well.. unless I use hard edges, which is a great downside for the scenario. Therefore my vegetation doesn't look as good as my architectures but instead it flickers in the distance. That's really bad.


That is common problem among all other games out there and is not related to the A8 engine in general.There are several options available when rendering transparent effects with alpha on consumer graphics hardware:

Alpha-testing uses a one bit value output by the pixel shader to determine if the output fragment is visible or not. Alpha-testing integrates well with common z-buffer techniques since all output pixels are fully opaque. However rendering with alpha-testing commonly gives rise to aliasing at the alpha edges, as you already mentioned.

Alpha-blending uses a scalar value output by the pixel shader to blend a rendered fragment with the destination pixel data. This is, when you "just" render your models without anything else... Though, when rendering layers of foliage with alpha-blending, z-buffering artifacts are common. This can largely be resolved if the rendered primitives are sorted to draw furthest from the camera first. Sorting primitives before rendering is usually a prohibitive CPU cost for game rendering and is not supported by Gamestudio, as JCL stated several times throughout the last 10 years here (geez... I'm getting old) smile

Real-time techniques for order independent transparency are becoming feasible on the latest hardware. Although interesting, these techniques are not yet a realistic approach for current generation games consoles and should als not be considered for PC games as well IMHO!

A third approach is called Alpha-to-coverage, it converts the alpha value output by the pixel shader into a coverage mask. This coverage mask is combined with the standard multisample coverage mask to determine which samples should be updated. Alpha-to-coverage, when combined with alpha testing, gives softer edges without sacrificing the ability to use the z-buffer with unsorted primitives. Although this is an improvement on simple alpha testing, the resulting alpha gradients can be of poor quality compared to those obtained in alpha blending. This is particularly true when using a low number of samples or on hardware that doesn't support flexible coverage masks.

The Alpha-to-coverage approach is used in several games out there and can be used very well with forward renderes like A8 together with postprocessing stages. I do something similar in my SSAO solution for softalpha sprites, but in a different way.

In practice, you render the scene twice or three times, depends on your setup (Images were taken from a whitepaper from the creators of the racing game PURE):

once without foliage:



once with writing out the blended alpha values and with a max operator:



and onces with foliage only (using alpha testing):



Then you combine everything in a postprocessing stage and you get softer edges with (kinda) sorted polygons:



So, theoretically, you could extend Shade-C by yourself or you ask BocHavoc if he implements exactly this technique.

[EDIT]

I have to admit that this works well for large scale foliage. Maybe you have to come up with a slightly different solution for grass foliage, due to the high amount of quads rendered. I could imagine a dynamically sorted model based on bones on the GPU could work out, too.
Posted By: Superku

Re: Shade-C v0.91 BETA S1 RELEASED - 04/23/12 22:10

Thanks for this post, HeelX, could you please post the link to the paper?
Quote:
This can largely be resolved if the rendered primitives are sorted to draw furthest from the camera first. Sorting primitives before rendering is usually a prohibitive CPU cost for game rendering and is not supported by Gamestudio, as JCL stated several times throughout the last 10 years here (geez... I'm getting old)

What do you mean with "primitives" in this case and what exactly is not supported?
Posted By: darkinferno

Re: Shade-C v0.91 BETA S1 RELEASED - 04/23/12 22:25

Originally Posted By: chris_oat
The WIND Flag does exist already in the Beta, but it does nothing yet.


It does work, sadly I don't have the sources anymore but I can confirm it works as I've used it for grasses and trees, hmm, I think you may have to reorganize some of the shader skills though

shadeC is rather nice but I realized most people don't even look into tweaking it, you will always need your own custom settings laugh
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 RELEASED - 04/23/12 22:35

Originally Posted By: darkinferno
[quote=chris_oat]
shadeC is rather nice but I realized most people don't even look into tweaking it, you will always need your own custom settings laugh

Yes, but then you break upgrade compatibility. Granted, wouldn't have been that bad when this last update had first been released since there was long delay, but it sounds like boh_havoc is still working on one so idk how much I'd want to deviate.
Posted By: HeelX

Re: Shade-C v0.91 BETA S1 RELEASED - 04/23/12 22:38

Sure, here is the link to the PDF: http://www2.disney.co.uk/cms_res/blackrockstudio/pdf/Foliage_Rendering_in_Pure.pdf

On this page you can find the slides and some videos, too: http://www.bungie.net/News/content.aspx?type=topnews&link=Siggraph_09

Quote:
What do you mean with "primitives" in this case and what exactly is not supported?


Triangles are basic primitives and the engine does not sort the triangles for you. The problem is that the Z buffer prevents from drawing pixels that are behind things that have already been drawn. Generally, that's pretty convenient - but when the thing in front is translucent, you NEED to see things that are behind it.

The first fix - upon which all the other fixes depend is to make sure you draw all your opaque polygons before you draw any translucent ones --- remember PASS_SOLID? Thats JCL magic. And that solves most of the problems. The only thing that remains is when you try to render one translucent polygon behind another, though, for many applications there are so few translucent objects that this is "good enough", but for forests and grass, well, you all know what happens and how it looks like...

The next thing that most people consider is to sort the translucent polygons as a function of Z depth. To be perfect - even sorting them isn't enough. You may have to split polygons up on-the-fly to get a perfect rendering. Imagine a large triangle of a tree entity intersecting another large triangle of another tree entity... ouch. There are so many cases of intersecting polygons that it is impossible to render them properly without splitting up at least on polygon. Worse still, if you decide to split and sort polygons - what key do you sort on? The center of the polygon? The nearest vertex? The furthest? You *will* get errors for any acceptable realtime algorithm. AFAIK, Gamestudio has no algorithm like this implemented - for good reasons, which are Simplicity and Speed. Especially nowadays everyone is rendering tons of polygons each frame, more than once maybe... so, it makes more sense to use postprocessing solutions, like the one I mentioned above.
Posted By: Superku

Re: Shade-C v0.91 BETA S1 RELEASED - 04/23/12 22:59

Thanks!
Yes, that's true, I was just wondering what you meant with primitives. For my side-scrolling game I normally use a different technique for transparent entities, I don't use entity.alpha. Instead, I render the entity in solid mode, suppress it in the default camera view and grab the pixel at the projected position. It's not "real" transparency but I like the effect (http://www.superku.de/sk_transparency.jpg) and no polygon issues are visible.
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 04/24/12 07:08

Thanks for explaining HeelX, what's up with SSAO? Have you been using the Wastelands assets I sent you last year?
Posted By: HeelX

Re: Shade-C v0.91 BETA S1 RELEASED - 04/24/12 12:27

Originally Posted By: PietroNifosi
what's up with SSAO? Have you been using the Wastelands assets I sent you last year?


Hey Pietro! I didn't worked on SSAO since the 0.6 release for various reasons. I really like you artwork but I didn't used your assets, though. I have the strong belief that if I release my solution for free to the users, all contents (especially the demos) should be open, too - don't take it personal, I really appreciated that you shared the stuff with me. I considered to make an industrial- or a forest-demo or something with the Dexsoft assets, too, but I found the idea silly to put everything into resources, so I skipped that.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 04/25/12 16:28

Nice postings about alpha problems in games there HeelX! laugh

The main reason why i'm not using anything else than alphatesting at the moment is Shade-C using a deferred approach. In the past it was using deferred lighting and now it's using deferred shading. Thus implementing soft alpha values is kind of hard (not impossible).
Currently i have planned to use auto stippling in combination with slightly altered FXAA or MLAA. This would give 4 Alpha values which can fade into each other because of the FXAA/MLAA. The downside of this is that you have to activae FXAA/MLAA of course. But "at least" this will also give you nice anti-aliasing besides removing the stippling pattern. wink Plus it's pretty fast (compared to "normal" AA techniques that is...but then again what's normal these days).
The way the Pure guys are doing it is a nice approach but also has it's problems (if there are multiple alpha materials behind each other, you will get hard edges where the alpha materials overlap). Not saying it's a bad approach though!


If you guys know any other methods to get around the deferred shading <-> smooth alpha problem, post them! I already have a lot of shader papers, but one can never have enough wink
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 05/02/12 16:06

Havoc I have noticed something in Shade-C EVO.
Whenever I load up a scenario I have a certain framerate depending on its complexity, right after a few seconds (or a minute or so) my framerate drops down regardless of the complexity that the camera is facing.
A few seconds later the framerate goes back to normal.
And again after a few seconds-minutes.
Do you have any idea what is happening?

PS = could you give us an estimate for the next EVO release? it-s been more then a year now frown
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 05/03/12 01:44

Quote:

Havoc I have noticed something in Shade-C EVO.
Whenever I load up a scenario I have a certain framerate depending on its complexity, right after a few seconds (or a minute or so) my framerate drops down regardless of the complexity that the camera is facing.
A few seconds later the framerate goes back to normal.
And again after a few seconds-minutes.
Do you have any idea what is happening?


This might be some sort of memory leak or the garbage collector going crazy (because there's too much garbage...). I had similar problems in the past and did my best to fix it. So far the only reason why my framerate drops again is because of my gfx-card getting way to hot (as soon as i start blowing at my laptop the fps go up again :D). So i GUESS it's fixed in the version i'm working on at the moment. *fingers crossed*

Quote:
PS = could you give us an estimate for the next EVO release? it-s been more then a year now


I have PLANNED to integrate the newest version into CSiS this month, so there is a CHANCE that i MIGHT release it somewhen in June. But don't count on it.
Sorry for the "when it's done" stuff, but that's how it is. I won't give any more potential release dates as i can't stick to them anyway... grin


Have look at my to-do list and see why it's taking so long wink
### = done
+++ = partially working/working on it. Essential for next release
* = should be in next release if there's time left
Quote:

### port to full deferred shading
### fallback forward renderer
### Reuse deferred view Z-Buffer for lightview and forward view
### Use shared rendertargets whenever possible
### store material properties in 1D texture (1x256) instead of 3d. Fetch with material ID. Max of 256 materials. 4 Properties per material possible.
- OR store material properties in 2D texture. Fetch with material ID. -> More material properties in one texture. (Use y uv for property adressing. texture-height * 4 values per material possible)
* compute brdf LUT on the fly using actual shaders & RTs
* get on-the-fly volumetric texture creation to work ... this might get hard without a dll
### dof (port from old shade-c)
### pseudo bokeh dof
### fix dof edgebleeding
- fix dof foreground objects (should have blurred edges)
### ssao (port from old shade-c)
### ssdo
* MLAA (port from old shade-c) FXAA SMAA DLAA etc
- auto stippling or some other way to get smooth alpha in deferred view
### refractions (port from old shade-c)
- no hard model edges for shield and shieldburn -> multiply alpha with velvety
* water
- refract example fx
### (soft) particles/fog (port from old shade-c)
###- Acknex particle: render in forward view. use ZBuffer from gBuffer generation!
+++ projectors
+++ local lights and shadows (port from old shade-c)
### Get volumetric textures working
- light probes (save lightprobes in volumetric texture, then fetch/lerp correct probe(s) in deferred_finalize.fx based on ID)
- distance based lights projection map: use a volmap with 2 textures, one sharp, one blurred. Fetch projection based on attenuation
+++ directional lights and shadows (port from old shade-c)
- cloud projection map for directional lights
- "volumetric" decal. Project Texture using a cube and worldposition OR cube+matrix (like spotlight)
- transparent decals: render in forward view. multiply with deferredLighting buffer. use ZBuffer from gBuffer generation
- wind vertex animation for gBuffer materials
- POM/PM for gBuffer materials
- detail diffuse/normalmap for gBuffer materials (simple and tri-planar)
* terrain (using volumetric maps for up to 255 textures), blend using double noise. Using grayscale 8bit(=255 values) blendmap or slope/heightbased
* teamcolor for gBuffer materials
- CSSM shadows (Boris Vorontsov)...this might get hard
### #define for mtlSkin instead of entSkin for gBuffer materials
- screenspace lensflare with maskmap/precomputed lensflaremap http://www.gamedev.net/topic/620699-bf3-lens-flares/
- screenspace lensflare -> http://www.john-chapman.net/content.php?id=18
- dynamic shadowmap accumulation -> http://www.john-chapman.net/content.php?id=14
- volumetric spotlights -> http://www.john-chapman.net/content.php?id=16
### better ssao (?) -> http://www.john-chapman.net/content.php?id=8
- faster MLAA (?) -> http://www.gamedev.net/topic/620689-smlaa-a-less-blurry-mlaa/
- film grain post process
- godrays (port from old shade-c)
- screen space sss
-> http://www.iryoku.com/sssss/
-> http://www.iryoku.com/translucency/
- screen space reflections (mirrored UVs based on screen-space nomals and view dir ... ?)
- gamma correction


+++ xml based materials (define material id, brdf lightfunction, diffuse roughness, diffuse wrap)
- xml based settings with load/save function
- in-game shader adjustment with save/load function for effects and objects


- Get A8 somehow
- add support for GPU bones
- create custom PSSM shader, but use A8's PSSM functions



laugh
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 06/08/12 22:28

Just got an A8 Pro from rojart (thanks again friend! Also for germanunkols additional version!) and could give Shade-C + A8 a try. To my surprise it actually works!
The only thing that's not behaving correctly is the skycube (looks like it's not being recognized as a cubemap).

Also CSiS got the newest version of Shade-C integrated. Now i have to wait and see if everything works as expected (i'm already preparing for germanunkol's rant for all the new bugs i "implemented" grin ).
As soon as we have thoroughly tested the new version, i'll post the new shade-c here for you guys to try.


In the meantime, here's screen space lensflares:








Posted By: Rackscha

Re: Shade-C v0.91 BETA S1 RELEASED - 06/08/12 22:50

Originally Posted By: BoH_Havoc

As soon as we have thoroughly tested the new version, i'll post the new shade-c here for you guys to try.


OH, cant wait o.o
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 06/17/12 07:29

@BoH_Havoc
These features sound amazing!

can't wait for it frown
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 07/04/12 05:41

Havent heard anything on this in a while. Just wondering how things are going with this amazing tool!
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 07/04/12 06:49

Originally Posted By: exile
Havent heard anything on this in a while...


nothing unusual about it... wink
Posted By: Rondidon

Re: Shade-C v0.91 BETA S1 RELEASED - 07/04/12 11:02

They`re working on a new, awesome release. Just be patent. It will be worthwhile. laugh
Posted By: PietroNifosi

Re: Shade-C v0.91 BETA S1 RELEASED - 09/09/12 19:55

It's been a long time, again! Are we getting an update soon? I can't work with a scenario that freezes every now and then because of the incredible amount of garbage collection.
I can assure you that it's not due to the complexity of my levels. I can run the same level with 1/10 of its complexity and still get the same framerate and the same freezing issues. So far I've spent countless hours optimizing here and there with mesh and texture LODS, and yet no luck.



This is how it looks like, but it's unfortunately unplayable at this stage.

Keep reading.. it gets worse..

Couple of years back I was kindly asked to be a beta tester for this shader pack, because of the quality of my productions. Even though I've provided feedback, I've always got very little almost no support at all.

After all these years waiting (and I'm talking about 2 years at least) and being stuck in development..

-IF-

..this next version turns out to be incompatible with A7, there is simply no way I'm going to waste my money on A8 not because it's expensive, simply because it's not worth it.

Let me explain:

The only reason I've spent years using gamestudio was to prove that a good looking professional title could be done using such a cheap and (pardon me but it's the truth) mediocre tool.

Here: http://www.youtube.com/watch?v=xouz5CP-vjo&list=HL1347306773&feature=mh_lolz

There are comments of people that don't even want to believe this is done with gamestudio! That's a bad omen.

And infact, have you ever compared most of these gamestudio projects to other people's using alternative engines?
There is simply no contest! why? because this is so limited in terms of support, engine performances, skills requiered, efforts requiered, very common features such as decent shadow stencils still unavailable because of being bound to licenses. To get fast real time shadow stencils I have to spend 800 euros and buy pro- That's silly considering it's now the year 2012!

I asked for support (many times), I've only received arrogant replies of people assuming I'm a programmer so "go study and sort it out". Disappointing.

And I wonder, wasn't a third party engine supposed to be easy to use for making games? Now that I think about it, on the frontpage of Gamestudio, there's a review that clearly states "videogames development never been easier". Oops guess not?!

That's exactly why everyone nowadays migrated to Unity, UDK or similar.
However, you don't care apparently. So why should I?

I think you've just lost a customer, a very old one, infact, someone that has been around since A4- and I'm confident that you've already lost several others during the past few years- and that you'll lose many others in the near future.
Posted By: Sajeth

Re: Shade-C v0.91 BETA S1 RELEASED - 09/10/12 10:04

It's not Shade-Cs fault that Gamestudio is going down.
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 09/10/12 13:22

Originally Posted By: PietroNifosi
I can't work with a scenario that freezes every now and then. Beautiful for making screenshots, but unplayable.
I use the same Beta-Build as you and i activated all effects and i never noticed any Freezes caused by Shade-C.

Originally Posted By: PietroNifosi
It's been a very long while again! are we getting an update?
yes it really take soo lang to get an update, and I dont even know if he stil works on it.

Originally Posted By: PietroNifosi
-IF- this next version turns out not to be compatible with A7 anymore, there is just no way I'm going to waste my money on A8 not because it's expensive, simply because there's so much better out there and for free even!
Damn! I hope thats just a rumor!?! smirk

Just hang in there! I do the same. I build my game with the beta of Shade-C how far as i can. For me it will almost make no difference if i create my levels with the beta or the finished Shade-C...and if my Game ever sees the finish-line and hopefully can add Shade-C in its whole beauty.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/10/12 19:41

Here you go, most recent version, just a couple of hours old. It's a development build, so don't expect ANY support from my side at the moment.

https://github.com/BoHHavoc/ShadeC-EVO

the link will always lead to the most current development build. Whenever i change something on Shade-C, i'll also upload it to github.

And once again, i can't stress this enough, i can't give ANY support right now as i'm busy with A LOT of projects (my master thesis is one of them) and i DO know that the build you can get on github is not perfect (at least it won't crash and should not have any major errors).

The reason i didn't post the link to github earlier is because it's still not finished and i don't want people screaming around "IT DOESN'T WORK!!!!1111". This happened a lot in the past (by PM and E-Mail) and it seems people forgot that i was doing all this for free (well at least that last part has changed now).

The reason i didn't send any more betas to testers was because i didn't had much time to actively fix bugs and therefore a beta test made no more sense.

Please feel free to CONTRIBUTE to Shade-C. If enough people start working on it, i will abandon the need for a license. I'm tired of all the rants as to why its not finished, yet NO ONE EVER helped out with improving the code. You were always free to improve it, the code was always there, yet no one did it...
And thats the whole reason why theres a license fee now. You are free to try, but once you start publishing screenshots/videos/games which use Shade-C, you have to get a license which is 100€ per seat or 100€ per team per game.
If you are one of the 3 guys who donated in the past and want to get a license, please get in contact for a special refund. I think i still have those 3 E-Mails from PayPal. laugh

All Contributors who actively help IMPROVING Shade-C will get a free license. This can be in form of tutorials/examples, filling the wiki on github, writing a manual (doxygen?), improving the code, creating a demo level (which should be free to use for anyone who downloads it!), etc.

These are the users who are free to use Shade-C, as they already contributed in the past (models, tutorials, A8 license, etc):
rojart (THANKS!)
PadMalcom
darkinferno
PietroNifosi
If i forgot somebody, please get in contact.



/end of pseudo rant wink


If you guys want, i can always post in this thread once i publish a new version on github.

Some shots with 2 shadowcasting spotlights (softshadows), directional shadows using PSSM (softshadows), SSAO, Bloom and ScreenSpace Lensflares. Runs at ~250fps/~1ms on my old GeForce 9800GT . You can get the example on github











Posted By: paracharlie

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 02:04

There is always Unity
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 06:01

paracharlie@ sure, there is! so please, don't waste your/our time, go for it!

BoH_Havoc@ mate, as always I'm amazed by your work man. Sorry my knowledge isn't (wasn't) enough to help you with developing this great product and I can't donate at the moment, but I'll be happy to help you with testing, finding bugs stuff. Please, keep Shade-C up!
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 06:05

I have to agree with Havoc on this one. I am a programmer, and I have just never been able to grasp shader programming (HLSL). I am tired of hearing "Its so easy, go learn, blah blah blah". The fact remains that for ME HLSL just doesnt compute with me for some reason. Now if there was a visual tool where I could visually add effects to create a shader (Like an HLSL version of photoshop) I could really get into that. But unfortunately there isnt, and try as I might I just cant learn HLSL. So I rely on contributors like Havoc here who CAN offer a great solution to my weak points. And if getting this help means I have to cough up a bit of cash then so be it! He's been doing a great service to the community and he's never asked of anything in return. In my opinion he's well earned my $100. If I could contribute in any way I would, but again I am very weak/inexperienced in HLSL so I just dont think I would be of much use.
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 11:32

Originally Posted By: BoH_Havoc
You are free to try, but once you start publishing screenshots/videos/games which use Shade-C, you have to get a license which is 100€ per seat or 100€ per team per game.


Does that mean me/we have to get a License NOW or when its done?!
Dont get me wrong, I love Shade-C and im so much thanksful to you for doing this, but buying a License NOW and having the risk of never receiving a finished product is not reasonable.
As soon SHade-C is finished I instantly will get a license.

and I do hope A7 is stil supported???
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 12:23

Not really Supported, camera.bg is for exmample not available in A7.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 12:51

Quote:

Does that mean me/we have to get a License NOW or when its done?!
Dont get me wrong, I love Shade-C and im so much thanksful to you for doing this, but buying a License NOW and having the risk of never receiving a finished product is not reasonable.
As soon SHade-C is finished I instantly will get a license.


You are free to try Shade-C for as long as you like. There's no need to get a license for that.

Once you start publishing material (images/videos/demo/release/etc) of your project (Showcase thread, game magazins, websites, compiled demo, etc) you need to get a license.

You don't have to get a license if:
- your project is open source
- you are posting bugs of your project or Shade-C
- you are helping other Shade-C users and have to post screenshots/videos to do so
- you are publishing work in progress material of your project
- you contribute(d) something to the Shade-C project

I just uploaded a version with A7 fallback. To activate A7 mode, #define SC_A7 before including shade-c.

Code:
#define PRAGMA_PATH "shadec"
#define SC_A7 //activate A7 mode
#include "shade-c.h"



Please note that PSSM shadows wont work in A7 mode and you might encounter minor visual errors with local shadows.

Get it here: https://github.com/BoHHavoc/ShadeC-EVO
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 12:56

A.W.E.S.O.M.E!!
If you reall finish this, you can be sure, that you´ll get a lot of money wink
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 12:59

Forgot to update the actual source and not only the example folder. Fixed that now.
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 12:59

ok i do unstand that, but im already posting picture of my game using Shade-C. My Game is not finished yet nor is shade-c.
Does that mean i have to get a license NOW or i have to remove the screenshots?
C'mon dont be so strict!
i dont want this to be another "Intense-X" case, where you bought ur license and in the end you never get the promised product.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 13:02

In that case it's work in progress and you don't need a license as already stated

Quote:

You don't have to get a license if:
- your project is open source
- you are posting bugs of your project or Shade-C
- you are helping other Shade-C users and have to post screenshots/videos to do so
- you are publishing work in progress material of your project
- you contribute(d) something to the Shade-C project


Additionally you were using an older version which WAS and IS still free.


Sorry for all the confusion wink
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 13:06

ok thanks, maybe i should read really ALL before I ask laugh
you are awesome!

SHADE-C POWER!!! laugh
Posted By: MasterQ32

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 14:31

I've got some weird behaviour with the shadows:
The resolution of the shadow maps is here at 2048, but this also happens when the resolution is default 512.
It also not happens all times but only some times...
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 17:26

Can you post your gfx card model?
Looks like it does not support 32bit floating point texture filtering.

Strange though that it doesn't happen all the time...

[edit] I think this might really be the case, as local shadows seem to be working fine on your screenshot. Local shadows aren't using the 32fp format but 16fp instead.
Posted By: MasterQ32

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 17:35

I think my graphcis card should support 32p float bitmaps, because i'm using them in my own shaders (but not in this project)
Model: Radeon HD 6870
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 20:56

@BoH_Havoc

o.o ( <= my face right now )
sooo nice! smile

But I've got a little question:
If I'll use this in my projects, am I allowed to modify it?
I thought about using the bloom shader from my own HDRR-Shader pipeline instead of the standard shade-c one ( I don't like it that much frown )

but except this I totally love the new version!
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/11/12 22:18

@MasterQ32: I was talking about filtering 32bit floating point textures, not being able to use them laugh Your HD 6870 should be more than capable to filter them though.
Can you confirm that the spotlight shadows are always soft? That would at least give me a point to start from wink

@Kartoffel:
Of course you are allowed to modify it. You are actually encouraged to modifiy it anyway you want. Let me know when you implemented your HDR pipeline and i might implement it into the main version if it's fast, along with a free license for you laugh
Please keep in mind that i plan to add LogLUV encoding to the pipeline where its needed. So in the end we might get away with standard argb8 textures. It might be a good idea to wait ~7 days before you try to add your own hdr pipeline as i plan to add logluv in the next days (mainly due to the lighting buffer having some banding artifacts).
If you have a better bloom shader at hand, along with tonemapping and whatnot, please give it a try. I too am not to satisfied with the current bloom. laugh

Here's a list of current tasks, so you know whats coming up: https://github.com/BoHHavoc/ShadeC-EVO/issues?milestone=1&sort=created&state=open
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 09/12/12 06:45

@BoH_Havoc: Honestly, do you ever see an (Finished) end for Shade-C? God, i tried the latest version yesterday and i was shocked...
Sure it looks nice and runs fast but...
i was one of the betatesters of the version right before that (where you implemented MLAA, SSAO etc) and ALMOST EVERYTHING changed again!! frown
now its not required anymore that models need an action assigned and all the setup commands/parameters have totaly changed.
Plus Im on A7 and had to realize i have no sunshadows anymore (yes because i dont have PSSM)
what will happen if there is A9 now with totaly different stuff in there again? You have to rewrite all again??

And when I look at the To-Do List i see alot of work ahead (im not into shaders) and by the Time thats ever finished all the other AWESOME(!!!) Stuff you implemented will be outdated again.

Now i understand why you want other users to work on Shade-C too, but i cant imagine how that will work...
I know you work close to the CSiS Guys and you probably handle all the changes better then i do, but for none-CSiS users its just best to wait for the final product.
But again BoH_Havoc, I really appreciate what you do, and I NOT say its your fault as you kept saying its all stil in Development.
Posted By: MasterQ32

Re: Shade-C v0.91 BETA S1 RELEASED - 09/12/12 06:55

Originally Posted By: BoH_Havoc
Can you confirm that the spotlight shadows are always soft? That would at least give me a point to start from wink

If you mean those other shadows which are soft on my screenshot, yes
only the moving (i think sun-) shadows were like this, but not all the time, only at certain sun angles (i can give you more information later, when i'm at home)

@chris:
i think every piece of software in development changes like this. sometimes you just get an idea which is 10x times better than the previous version. then you change it and while you change it the same happens twice again. so yes, end users should wait for the final release or adapt their code (which isn't that hard)
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 09/12/12 08:26

Quote:
Of course you are allowed to modify it. You are actually encouraged to modifiy it anyway you want. Let me know when you implemented your HDR pipeline and i might implement it into the main version if it's fast, along with a free license for you laugh
sounds awesome smile !

BUT: Im not very experienced with shader programming so my code is probably not very clean/efficient.

Anyways, I'll do this within this or the next week (haven't got very much time at the moment)

Here's a screen of my shaders, just for you to see how the bloom actually looks like:

For my bloom I'm using alpha-blending instead of add-blending which prevents overexposure and gives it a smoother look.
It also allows me to make the bloom much more visible without looking bad.

EDIT: I just read this:
Originally Posted By: BoH_Havoc
It might be a good idea to wait ~7 days before you try to add your own hdr pipeline
So I'll wait and try to make my shader-code better wink
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/12/12 14:02

@chris_oat: there won't be any more major changes anymore as i'm tired of them myself (as well as the CSiS guys). Plus i really like the pseudo oop sytle Shade-C has now, which also makes it easier for myself to change things without changing the way to use it. I'll try to add the "old" sun-shadows again.

@Kartoffel: That bloom looks nice, i'll give alpha blending a try laugh


Small Update:
Added Antialiasing in form of MLAA.
https://github.com/BoHHavoc/ShadeC-EVO
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 09/12/12 15:47

Originally Posted By: HoH_Havoc
That bloom looks nice, i'll give alpha blending a try


I did this today wink (the shade-c code is really good commented!)
I also added a 2nd blur-shader to make it smoother.

the result is not bad, but the lens flares which are added in the same step as the bloom is, don't look very good with alpha blending

Edit: Here are some screens for comparison. Left alpha-blending, Right add-blending.
Click to reveal..


oh and I found a bug. I'm not sure if you already know it, but if I run the application in fullscreen mode and switch to my desktop (Alt+Tab)
and switch back to the application again there aren't any pointlights or pointlight-shadows anymore, only the sun with PSSM is still there
edit: oh actually they are spotlights smirk
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 09/14/12 01:22

I found something else, though I think it may just be me. When I try to add shade-C to my project All I get is a blue screen (Background color) once shade-C gets called. I found it has something to do with the "sc_screen_default = sc_screen_create(camera);" line. I will keep experimenting to see what the issue could be. Could there be anything I am doing wrong? Also, I get a "script error in: sc_forward_destroy" error. Any idea why?
Posted By: Ch40zzC0d3r

Re: Shade-C v0.91 BETA S1 RELEASED - 09/14/12 05:04

Its setting your camera to origin. I had this bug really often.
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 09/14/12 08:55

Understandable, however I have my origin in the main menu set at 0,0,0. Its almost as though nothing is rendering except panels. If I find a resolution I will post it in the wiki.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/15/12 16:09

You have to use Shade-c's object shaders. Have a look at the "fx" folder as well as "common.h" in the example folder.

If you want to use your own shaders, you have to call sc_skill(entity, SC_OBJECT_PASS, SC_PASS_FORWARD); for every object that uses a custom shader. These object will then be rendered in a traditional forward renderer instead of shade-c's deferred renderer. Please note though, that you should only use custom shaders where you can obsolutely not use shade-c's objectshader, as custom shaders don't work together with a lot of Shade-C's effects (lights, shadows, ssao, depth of field, etc.). The only objects you might want to render in forward rendering are translucent objects. Everything else should be rendered using Shade-C's objectshader.


Please note, that all code in the example/fx folder will be moved to default.fx and the .fx files in the example/fx folder will only contain #defines and variables in the future. This is needed for easier updating the objectshader code in the future.
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 09/15/12 23:19

Ah I see now, got it working laugh One thing I think would be great to add is different types of material shaders. Like

Lava
Water
Grass
Tree
Plastic
Rubber
Plasma

etc...

Not sure if they can be useful but I have been trying to find a way to recreate some of the Unreal Engine 3 material shaders in A8. I can share them if you like.
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/16/12 20:45

I just somehow can´t get spotlights working. I want to attach one to the camera, but the shadowmap doesn´t gets updated.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/16/12 21:19

@exile:
I will get back to you on that offer! Have to create some hooks in the objectshader first so one can easily insert one's own code.

@alibaba
You have to call sc_light_update(ENTITY* lightentity); after you moved/rotated a shadowcasting-,projector- or spotlight around.


Updates:
I just finished merging all spotlight and directional light shaders into one big shader which is now placed in default.fx. Still have to add pointlights, then it's finished and you will finally be able to actuall USE the light flags like SC_LIGHT_SPECULAR or SC_LIGHT_SHADOW.
I also optimized the SSAO shader for more realistic results. SSAO will now only be visible in dark places and/or shadows (like in the real world). If you don't want this, there's a parameter to tweak the results. You can smoothly lerp between full ssao everywhere and ssao in dark places only.
Next Update should be ready by tomorrow.
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 05:30

Hmm.. still doesn´t work smirk
Here is the code and the result, when i move the camera:
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 12:10

Sorry, there was a bug which lead to the shadowmap view not being updated. The fix will be included in the next update.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 12:41

New Update:
https://github.com/BoHHavoc/ShadeC-EVO
Quote:

- Lightbuffer is now packed to support HDR (well... MDR at least)
- Lights support HDR values now
- Fixed bug where spotlight shadows didn't get updated when the light
was rotated
- All lightshaders were merged and put in default.fx
- Tweaked SSAO for a more realistic behaviour. Now only dark areas will
be affected by SSAO. If the user does not want this, he can tweak the
ssao to also be visible in bright areas
- Added additional scatter shader to bloom
- Added LOW, MEDIUM, HIGH and ULTRA quality setting for SSAO
- Light flags now work as they should
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 13:01

Awesome! Thanks! laugh
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 13:08

Hotfix for spotlights, forgot to also update position and arc. wink
https://github.com/BoHHavoc/ShadeC-EVO
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 13:11

Seems like it´s not working with A7 smirk
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 13:33

i had that too, i think you have to comment out the temp terrain shader which uses the d3deffect.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 13:39

Thanks for the info guys, fixed it:
https://github.com/BoHHavoc/ShadeC-EVO
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 14:02

Awesome how fast you are!
Posted By: lostzac

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 14:20

I read that the Terrain example is not ready yet and not to use it. How long do you think it will be as I am interested in testing it out ? No hurries as I can work on other things, more curiosity. Once you have it completed if you like I can write on tutorial for users on how to implement it if ya like.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 18:50

Small Update:
https://github.com/BoHHavoc/ShadeC-EVO

Quote:
Optimized sc_light_update


Fps raised from 140fps to 170fps with the new sc_light_update. Note to self: sys_free is evil, ptr_remove is nice.


Quote:
I read that the Terrain example is not ready yet and not to use it. How long do you think it will be as I am interested in testing it out ? No hurries as I can work on other things, more curiosity. Once you have it completed if you like I can write on tutorial for users on how to implement it if ya like.

Can't tell yet. Creating a simple terrain shader with 4-8 textures is easy. But i'm working on a terrain shader which supports up to 255 textures. It basically works, but blending is a problem with the current approach. Basically the Terrain Shader is on hold for now, until i finished porting the current object-/ubershader to default.fx along with an abstraction layer and custom function hooks. Once that is done, work on the terrain will start again and will be based on said object-/ubershader for easier updating in the future.
Posted By: Superku

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 18:54

Originally Posted By: BoH_Havoc
sys_free is evil

Why? Please explain.
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/17/12 21:21

Wow, looks really awesome when you combine everything! I´m thinking about remake Slender, but with HD grafics tongue


Besides i found some bugs, while testing the whole day:
- Changing resolution causes crash in Antialiasing example
- If camera.tilt is -90 you´ll get a whitescreen
- If camera.tilt is lower than -90 the shadowmap becoms wierd

But i think the tilt issues could be easy fixed by the user himself, by setting camera angle limits laugh

But all in all you´ve done a great work and it´s really fast!
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 09/18/12 07:33

terrain shader with 255 textures, crazy laugh
maybe more version of terrain shaders could be included, a fast&simple-to-use with 8 textures, and the extra complex...
Posted By: lostzac

Re: Shade-C v0.91 BETA S1 RELEASED - 09/18/12 08:16

Thank's for the quick response...As this is costing me nothing but a little time to write some tutorials or some help in some area like that, I am not gonna complain. I am sure you have a full plate with this and all the other projects your working on. Keep up the good work as this project is really a time saver for programmers like me who want to focus on other aspects of their game and not have to worry about things like shading.

Quote:
maybe more version of terrain shaders could be included, a fast&simple-to-use with 8 textures, and the extra complex...


I like the idea as I only need 4-6 LOL...
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/18/12 15:19

One more thing for your ToDo List tongue

After publishing i get an error:
"error:88760b59"
What does that mean?
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/18/12 20:22

I´m getting more and more into this Slender thing grin
Posted By: Rei_Ayanami

Re: Shade-C v0.91 BETA S1 RELEASED - 09/19/12 13:38

Btw, Slender is being redone, more professionally by the guy and a team now. Just FYI
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/19/12 15:17

New Update:
https://github.com/BoHHavoc/ShadeC-EVO
Quote:

- Moved all code of the Objectshader to default.fx
- Added Hooks to Objectshader to easily create/change/add functions, thus being able to create new shaders which derive from the base Objectshader
- Fixed "_destroy" crashes
- Fixed Gamma Correction
- Fixed SSAO Resolution Change
- Added Example 05


Quote:
After publishing i get an error:
"error:88760b59"
What does that mean?

This might be the default.fx or d3dcompiler_42.dll missing...try the new Update, i changed some things so this shouldn't happen again. Please let me know if it works.

Quote:

Quote:
sys_free is evil


Why? Please explain.

Because it does exactly what it should do, which was bad in my case wink creating and sys_freeing something every frame is slow (at least it is for me). ptr_remove seems like a better way of doing it, as in that case the memory is only marked as free, but not really free, so other objects can now write into that memory areas and just overwrite the old data (at least i think that's the way it works). If anyone has more info on this, please go ahead and let us know laugh
While further searching for info about this, i stumbled upon the safe_remove macro which i will use in the future. I always forget to manually set object = NULL after using ptr_remove. safe_remove does that job.








[edit] Here's some examples of what you can do when deriving from Shade-C's objectshader. Note how both objects cast correct shadows, although their shape is modified by a shader. Both examples are also included in the latest update.


Dissolve effect
Code:
//------------------------------------------------------------------------------
//----- USER INPUT -------------------------------------------------------------
//------------------------------------------------------------------------------

//assign skins
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_NORMAL (skin2.xyz) //normalmap
#define SKIN_GLOSS (skin2.w) //glossmap
//...

#define NORMALMAPPING //do normalmapping?

#define GLOSSMAP //entity has glossmap?

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

#include <scHeaderObject>


#define CUSTOM_PS_EXTEND
#ifndef VECSKILL1
	#define VECSKILL1
	float4 vecSkill1;
#endif
psOut Custom_PS_Extend(vsOut InPs, psOut OutPs)
{
	//fetch output color and calculate clip value from it
	half clipValue = (dot(OutPs.AlbedoAndEmissiveMask.xyz,1)*vecSkill1.x)-1;
	//apply clipping
	clip(clipValue);
	
	//output clipvalue to emissive buffer for some nice glow one edges where clipping will occur in the near future
	OutPs.AlbedoAndEmissiveMask.w = (1-saturate(clipValue))*0.05;
	//set emissive color
	OutPs.AlbedoAndEmissiveMask.xyz = lerp(OutPs.AlbedoAndEmissiveMask.xyz, vecSkill1.yzw, pow(1-saturate(clipValue),2));
	
	return OutPs;
}

#include <scObject>







wobbly bloomy thingy (vertices are moved around and object is put into the emissive buffer)
Code:
//------------------------------------------------------------------------------
//----- USER INPUT -------------------------------------------------------------
//------------------------------------------------------------------------------

//assign skins
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_NORMAL (skin2.xyz) //normalmap
#define SKIN_GLOSS (skin2.w) //glossmap
//...

#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

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

#include <scHeaderObject>


#define CUSTOM_VS_POSITION
#ifndef MATWORLD
#define MATWORLD
	float4x4 matWorld;
#endif
#ifndef MATWORLDVIEWPROJ
#define MATWORLDVIEWPROJ
	float4x4 matWorldViewProj;
#endif
#ifndef VECTIME
#define VECTIME
	float4 vecTime;
#endif
#ifndef VECSKILL1
#define VECSKILL1
	float4 vecSkill1;
#endif
float4 Custom_VS_Position(vsIn In)
{
	float3 P = mul(In.Pos, matWorld);
	float force_x = vecSkill1.x; 
	float force_y = vecSkill1.y;
	float speed = sin((vecTime.w+0.2*(P.x+P.y+P.z)) * vecSkill1.z);
	
	if (In.Pos.y > 0 ) // move only upper part of tree
	{
		In.Pos.x += speed * force_x * In.Pos.y;
		In.Pos.z += speed * force_y * In.Pos.y;
		In.Pos.y -= 0.1*abs(speed*(force_x+force_y)) * In.Pos.y;
	}
	
	return mul(In.Pos,matWorldViewProj);
}

#define CUSTOM_PS_EMISSIVEMASK
float Custom_PS_EmissiveMask(vsOut In, float emissive)
{
	return vecSkill1.w;
}


#include <scObject>



Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/19/12 15:51

Awesome! I´ll try it as soon as possible!
Originally Posted By: Rei_Ayanami
Btw, Slender is being redone, more professionally by the guy and a team now. Just FYI

Hmm bad smirk
However, i´m still gonna finish this, just to test the capabilities of Shade-C wink
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 09/19/12 16:01

Originally Posted By: BoH_Havoc

This might be the default.fx or d3dcompiler_42.dll missing...try the new Update, i changed some things so this shouldn't happen again. Please let me know if it works.


Still getting that error smirk
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 09/20/12 15:16

I will implement my bloom (and maybe some other) shaders to Shade-C this weekend if I'll have enough time.

But I've got 2 questions:
Does Shade-C already support adaption and does it support higher color-ranges than RGBA 0-255 (HDRR)
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/21/12 21:10

Quote:
Still getting that error smirk


I'll have a look at it again then wink

Quote:
Does Shade-C already support adaption and does it support higher color-ranges than RGBA 0-255 (HDRR)


adaption is not supported at the moment. You'll have to do the luminance map downsampling yourself. Lighting supports MDR-HDR values (medium to high range). To Unpack Lighting, #include <scUnpackLighting> and use float4 UnpackLighting(float4 input) to unpack. Lighting is stored in sc_screen_default.renderTargets.deferredLighting .
Everything else is non-HDR. However you can encode RGB to Log LUV to get a higher range. The functions for that are already implemented. To use, simply #include <scRGBtoLogLUV> or #include <scLogLUVtoRGB>. You can then use the functions float4 RGBtoLogLUV(float3 input) and float3 LogLUVtoRGB(float4 input).
The current pipeline is:
gBuffer->lighting->ssao->final composition using lighting,color,ssao,etc->antialiasing->forward rendering->refractions->DOF->Bloom/HDR
So i guess you'd have to encode the "final composition" part to LogLUV and decode in Bloom/HDR

Please let me know if you need something for your HDRR implementation and i'll try to implement it as soon as possible. laugh

[edit] Please get the latest version, there was a small bug with LogLuv encoding. -> https://github.com/BoHHavoc/ShadeC-EVO
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 09/23/12 21:08

I had some problems when adding new shaders and changing the order of the hdr render-chain... smirk
( I tried to add another bloom layer which uses the first bloom as source image for a second, high-radius bloom blur but with leaving the first bloom as source image for the lensflare crazy )

...looks like this was a bit too much for the beginning grin

However, I think and I hope that I finally understand it now smile
I started again from zero and I haven't had any problems this time.

At the moment I keep the bloom and lensflare images seperate to use alpha-blending for the bloom and add-blending for the lensflares with a setting to prevent overexposure.
For this I split sc_hdr.fx into sc_hdr_BloomAndLens.fx and sc_hdr_BloomOnly.fx.

Here is a screenshot which shows the new bloom effect pretty good.

I also added the integer settings.hdr.quality to change the downsampling and bloom quality with
SC_LOW: downsampling with 1 sample per pixel, 1 bloom-stage
SC_MEDIUM: downsampling with 7 samples per pixel, 1 bloom-stage
SC_HIGH: downsampling with 11 samples per pixel, 2 bloom-stages
SC_ULTRA: downsampling with 13 samples per pixel, 2 bloom-stages

Higher quality downsampling will prevent aliasing and makes it possible to use more downsampling and results in smoother blurring.
the bloom quality isn't affected by it, yet but this will be the next thing I'll add smile

I think I'll also add a video-grain effect, and if it's not too hard an adaption shader.
Posted By: Ch40zzC0d3r

Re: Shade-C v0.91 BETA S1 RELEASED - 09/24/12 17:33

Any idea why all my models and the level is all blue?
Its the same blue as my levelbackground.
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 09/25/12 01:32

You have to assign a shade-c shader to them.
Posted By: Ch40zzC0d3r

Re: Shade-C v0.91 BETA S1 RELEASED - 09/25/12 04:51

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 ...
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 09/25/12 12:56

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.
Posted By: Dark_samurai

Re: Shade-C v0.91 BETA S1 RELEASED - 09/25/12 14:54

Isn't it possible to overwrite the default material that is used for blocks? Try to assign the shader to this default material.
Posted By: MasterQ32

Re: Shade-C v0.91 BETA S1 RELEASED - 09/25/12 16:14

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
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/25/12 16:33

@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.

Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 09/26/12 02:24

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.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 09/26/12 09:28

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
Posted By: Ch40zzC0d3r

Re: Shade-C v0.91 BETA S1 RELEASED - 09/26/12 13:02

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;
}

Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 09/26/12 21:24

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)
Posted By: MasterQ32

Re: Shade-C v0.91 BETA S1 RELEASED - 09/26/12 22:03

one question from my side:
is shade-c able to render lights on transparent surfaces?
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 09/26/12 22:36

I think so... but not with deferred rendering
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 09/28/12 03:06

Are there any particle materials? I've tried looking but I havent found any outside of the soft sprites, which I dont think can be used for particles.
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 09/28/12 12:45

I'm not sure if particles work together with shade-c at all.

But if the effect doesn't require too much particles, sprites should work.
They're a bit slower but you also have more possibilities with them (shaders, rotating, ...)
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 10/03/12 14:26

@MasterQ32: Transparent objects are only supported in the forward renderer at the moment. To use, set sc_screen_default.settings.forward.enabled = 1; . You then have to set sc_skill(ENTITY* ent, SC_OBJECT_PASS, SC_PASS_FORWARD); for every object which should be rendered in the forward renderer instead of the deferred renderer. You can then apply any material/shader you want to these objects (e.g. a translucent shader).
There will be basic support for deferred translucent objects in the future using a variation of a technique called "alpha stippling" and "inferred rendering".

@exile: You have to enable forward rendering for particles to work. To do so, set sc_screen_default.settings.forward.enabled = 1; . You can now use particles.
Posted By: painkiller

Re: Shade-C v0.91 BETA S1 RELEASED - 11/02/12 13:34

Is it possible to use environment mapping f.i. on the car shader?
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 11/03/12 09:37

It should be possible but I'm not sure how to do it, sorry smirk
However, it looks like BoHHavoc plans to implement Screen Space Reflections:


(I think it's based on the technique Superku posted some time ago)

They can produce better results - because they actually reflect the scene, not just a cubemap - and they are faster and extremely efficient.

Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 11/05/12 18:13

Any news about Shade-C? confused
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 11/11/12 13:27

Environment mapping is currently not implemented as i want to create a deferred method for this instead of a forward method.
It also isn't possible to derive from Shade-C's objectshader and implement it yourself, as the position is not passed to the pixelshader. I'll add this in a future release (or some way to change in/output of the vertexshader when deriving from Shade-C's objectshader).

I will implement screenspace reflections, as Kartoffel already mentioned. They are more easy to handle (for the user), but have limitations (for example only things which are on screen can be reflected).

The masterplan is to implement an automatic environment-/lightprobe system to get "realistic" results but this will take a while and has no high priority at the moment.


News on Shade-C: No news, except that Kartoffel sent over a nice Bloom/HDR mod which will be implemented next. Thanks again for that! laugh Before that i have to fix some other things though which are need for CSiS. I hope to do that this week and then go on with fixing bugs and implementing new features.
Posted By: painkiller

Re: Shade-C v0.91 BETA S1 RELEASED - 11/11/12 15:06

Well I said environment mapping because it was the most simple method, I just wanted to ask for a shader which could look good for a car model, and screenspace reflections will give better results for sure laugh
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 11/13/12 18:39

Quote:
No news, except that Kartoffel sent over a nice Bloom/HDR mod which will be implemented next.
just if someone is interested in what exactly it includes:

- (imo much) better overall bloom quality
- some improvements in the blending-mode of the bloom and lensflare effect
- a video-grain effect
- a vignette effect
- (kinda filmic) tonemapping
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/03/12 09:58

What about built-in vegetation shader? laugh Would be great!!
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 12/03/12 14:13

What exactly do you mean with "vegetation shader"?
A shader that does for example the grass animation or something like this?
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/03/12 14:54

shader, which will support main shade-c stuff (shadows etc, plus normalmapping) and will do grass animations etc. I guess that I can implement the one from gs, but it will be better to have such stuff build-in!
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 12/03/12 15:16

Shade-C uses deferred rendering so all the lighting is done by post-processing shaders which means that you don't have to do any of this in the object shader.

It also uses a default material which allows you to create a shader by just commenting / uncommenting #defines and it supports custom pixel- and vertexshader
which can be used for example to enable vertex displacement - like for vegetation shaders wink

Well, this probably sounds a bit complicated now, but it really isn't laugh

you set some material settings like this:
Code:
//assign skins
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_NORMAL (skin2.xyz) //normalmap
#define SKIN_GLOSS (skin2.w) //glossmap
//...

#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


and create a custom vertex shader for the animation:
Code:
#define CUSTOM_VS_POSITION
float4 Custom_VS_Position(vsIn In)
{
	float3 P = mul(In.Pos, matWorld);
	float force_x = vecSkill1.x; 
	float force_y = vecSkill1.y;
	
	float speed = sin(vecTime.w * vecSkill1.z);
	
	In.Pos.z += speed * force_x;
	
	return mul(In.Pos,matWorldViewProj);
}


You don't have to worry about the lighting, normalmapping, shadowmapping, etc.
that's all done by the default material and the deferred rendering wink
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 12/12/12 13:52

Finally someone making use of the shader hookups. Hooray! laugh

No update from my side due to heavy workload at the university. I really hope to have some time during the christmas holidays to implement Kartoffels Stuff.

Can't believe it's been over 2 months since the last update. Why is time passing so fast in this last few months... tired
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 12/12/12 14:15

you should go to holiday in the next semester to deal with only shade-c laugh
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 13:41

Update

Quote:

- Changed sunshadows from ESM to PCF
- Added sunShadowRange parameter to manually limit the PSSM Shadows for those who don't need dynamic shadows in the far distance
- Added sunShadowBias parameter
- Fixed Particle Rendering (BRIGHT flag now works as it should)
- Not really fixed, but "not as broken as before": Far clip aliasing (was resulting in black stripes and dots). Still not right as very far objects aren't affected by sunlight. But it's not as noticeable as before.
- Proper sky clipping for the sunshader. Sunlight should be rendering faster now if parts of the sky are visible on screen.
- Various Bug fixes i can't remember wink


This update fixes most of the bugs we encountered in CSiS.
Also sunshadows should now render correct on all systems (there were problems with filtering before on some systems).
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 15:33

New update, yay grin
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 21:30

Hotfix
Quote:
MLAA was resulting in a black screen in some cases due to a wrong StencilBuffer


https://github.com/BoHHavoc/ShadeC-EVO
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 21:46

<blurred>
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 21:54

Yeah that was already in the first sc-evo version.

I think that's not really a problem 'cause there's nothing to show.
The important part is the code which describes how to implement shade-c to a project wink
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 21:58

Potato, I don't see the same problem with the very first demo, it works flawlessly to me.
You rather didn't get my point or trying to act as a smartass! No meant to offend, just saying wink
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 22:04

Well... then I'm sorry blush

But I know this issue was already there in the previous version grin
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 22:08

Man, that is strange, cause it works pretty nice for me.. HDR is adjusting it brightness to a specific point, and then stops, but doesn't disappear.. as in new updated version, maybe this has to do something with my PC:
Quote:
AMD Radeon HD 6670 (updated drivers)
AMD Athlon(tm) II X4 641 Quad-Core Processor 2.80 GHz
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 12/18/12 22:16

strange, indeed...
besides that, afaik there shouldn't be any brightness adjustment since shade-c doesn't support adaption crazy
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 12/19/12 02:30

This is intended in 01.c , it's just so something moves at all as there is nothing in the scene wink

Have a look at the end of main() and you'll see this, which will increase HDR brightness.
Or do you mean something else 3run?

Code:
while(1) {
	sc_screen_default.settings.hdr.intensity += time_step*0.01;
	if( sc_screen_default.settings.hdr.intensity > 1) sc_screen_default.settings.hdr.intensity = 0;
	
	wait(1);
}

Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 12/19/12 09:30

Oops grin That was it, I just haven't looked throw the code.. But this never happened with previous versions for me laugh
Posted By: memoli

Re: Shade-C v0.91 BETA S1 RELEASED - 12/23/12 10:48

tnx for shade-c EVO Boh havoc . But i want to set the normal map ,specular map power like old version "shade-c_v0.91_BETA_S1"
for example
float specularExp = 50; // vecSkill1.y | sharpness of the specular lighting
float velvStrength = 0.3; // vecSkill1.z | velvety Strength


float bumpStrength = 4; // bumpmapping strength

How can i do this which parameters?


Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 01/03/13 17:24

In Shade-C Evo most values are now set by using textures or material and entity properties.

Bumpstrength can not be set by default, you have to create a stronger normalmap. (I created a shader which lets you set the normalmapstrength, though. See below).

SpecularExp is set through material.power
Additionally, in the below example:
- Emissive Color (if using an emissive mask) can be set through material.emssive_red/green/blue
- Object Color (if using a colormask) can be set through material.diffuse_red/green/blue
- Gloss strength can be directly set in the shader by setting GLOSSSTRENGTH to another value

Velvety lighting has been moved to the light shader and can only be used if you switch the lighting model (blinn-phong, lambert, oren-nayar, etc) for the entity and then set the wrap around value of the lighting model. I'm not satisfied with how it currently works, so i won't give an example on how to use it as it's subject to change. Sorry.

Code:
//------------------------------------------------------------------------------
//----- USER INPUT -------------------------------------------------------------
//------------------------------------------------------------------------------

//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
#define SKIN_EMISSIVEMASK (skin3.b) //emissive mask
#define SKIN_COLOR (skin3.g) //(team)color mask
//...

#define NORMALMAPPING //do normalmapping?
#define BUMPSTRENGTH 10 //strength of normalmapping

#define GLOSSMAP //entity has glossmap?
#define GLOSSSTRENGTH 1 //if entity has no glossmap, gloss will be set to this value

#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?

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

#include <scHeaderObject>
#define CUSTOM_VS_EXTEND
vsOut Custom_VS_Extend(vsIn In, vsOut Out)
{
	Out.Tangent = Out.Tangent*BUMPSTRENGTH;
	Out.Binormal = Out.Binormal*BUMPSTRENGTH;
	//Out.Normal *= 1000;
	
	return Out;
}


#include <scObject>

Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 01/05/13 11:34

I thought about creating a shader with relief mapping...

It should be possible but I'm not sure how to implement it into a custom shader for shade-c.
Are there any information about the #defines (especially the custom vs and ps), so how do they
work and what do the input- / output-structs include?

also I'd like to know if the depth for the deferred lighting's gBuffer is calculated
in the object shader or with a second VIEW*.

If it's done in the object shader it should be easy to manipulate it based on the relief-mapping's
depth result which makes it possible to use SSAO for the displaced texture laugh

EDIT: ...and the shadowing would be correct, too.
(except for self-shadowing, which can be done in the object shader)
Posted By: rojart

Re: Shade-C v0.91 BETA S1 RELEASED - 01/06/13 16:03

Hallo BoH_Havoc!
I started experimenting with EVO, and I have a few questions.

Is it possible to use more then one diffuse textures, both with alpha channel?

Like your car model example, but you use only one diff texture vloga_car_CS.tga and have omitted the second diff texture vloga_szyby_DA.tga to the glass effect?

Level maps dosen't works with normalmaps for now, they is a shader levelDefaultNM.fx implemented but without any effect?

BTW, very nice effects in 05.c example, it is possible to combine two effects or more at once, eg. mtlDissolve with mtlLivingBloom?

Thanks again for the updates!
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 01/06/13 17:22

"is it possible to use more then one diffuse textures, both with alpha channel?"

Yes it is. You need a custom pixelshader for that, nothing really complicated but I don't know how to use it. BohHavoc has to answer this.


"very nice effects in 05.c example, it is possible to combine two effects or more at once, eg. mtlDissolve with mtlLivingBloom?"

Yes but you have to combine both shaders to a single one, so some HLSL knowledge is required.
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 01/08/13 02:50

Update:
Quote:

- Implemented Stencil Masking to speed up PCF Sun Shadows ( as described here http://www2.disney.co.uk/cms_res/blackrockstudio/pdf/Rendering_Techniques_in_SplitSecond.pdf )
- Added dynamic branching for the Sun Shadows
- Slightly better Gamma Correction
- Fixed Sky Bug when using Sky Entities/Domes instead of Skyboxes
- Added support for GPU Bones. use the BONES flag in an objectshader or shadowshader to activate
- some small fixes and tweaks here and there


@Kartoffel: I'll compile a list with all possible hooks. I'll also implement a way to change the input and outputs of the vertexshader and pixelshader as i think you'll need the viewDir which currently isn't generated anywhere laugh
About the depth: It's rendered in the object shader, as well as the normals, emissive...well everthing which will be put in the gBuffer. There is no second view used to generate the gBuffer.

@rojart:
Quote:
Is it possible to use more then one diffuse textures, both with alpha channel?

You can use "unlimited" diffuse textures if you also add the other maps as well which are needed for the shader. If you have a model/material which has only needs diffuse maps you are good to go. If you have a model/material which has diffuse and normalmaps, you have to make sure they are applied the right way: For every diffuse map, there has to be a normalmap.
The skines of a model with normalmapping and 2 or more diffusemaps would look like this:

diffusemap1
normalmap1
diffusemap2
normalmap2
...

More info here: http://manual.conitec.net/med_manage_skins.htm

Quote:
Like your car model example, but you use only one diff texture vloga_car_CS.tga and have omitted the second diff texture vloga_szyby_DA.tga to the glass effect?


The way the maps are applied is wrong (see above), as i didn't attach an additional normalmap for the windoe diffuse map. I didn't care for the windows when i created the example blush I'll fix that in a future version.

Quote:
Level maps dosen't works with normalmaps for now, they is a shader levelDefaultNM.fx implemented but without any effect?


They do work. Have a look at common.h "mtl_levelDefaultNM". The levelmaps in the examples have this shader applied. It's just that the normalmaps aren't that strong in the example and therefor the effect might not be visible at first glance.

Quote:
BTW, very nice effects in 05.c example, it is possible to combine two effects or more at once, eg. mtlDissolve with mtlLivingBloom?


Sure. In that SPECIFIC case you can just copy and paste from one to the other and it'll almost instantly work (you have to change vecSkill1 to vecSkill5).

New living bloom OBJECT SHADER
Code:
//------------------------------------------------------------------------------
//----- USER INPUT -------------------------------------------------------------
//------------------------------------------------------------------------------

//assign skins
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_NORMAL (skin2.xyz) //normalmap
#define SKIN_GLOSS (skin2.w) //glossmap
//...

#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

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

#include <scHeaderObject>


#define CUSTOM_VS_POSITION
#ifndef MATWORLD
#define MATWORLD
	float4x4 matWorld;
#endif
#ifndef MATWORLDVIEWPROJ
#define MATWORLDVIEWPROJ
	float4x4 matWorldViewProj;
#endif
#ifndef VECTIME
#define VECTIME
	float4 vecTime;
#endif
#ifndef VECSKILL1
#define VECSKILL1
	float4 vecSkill1;
#endif
float4 Custom_VS_Position(vsIn In)
{
	float3 P = mul(In.Pos, matWorld);
	float force_x = vecSkill1.x; 
	float force_y = vecSkill1.y;
	float speed = sin((vecTime.w+0.2*(P.x+P.y+P.z)) * vecSkill1.z);
	
	if (In.Pos.y > 0 ) // move only upper part of tree
	{
		In.Pos.x += speed * force_x * In.Pos.y;
		In.Pos.z += speed * force_y * In.Pos.y;
		In.Pos.y -= 0.1*abs(speed*(force_x+force_y)) * In.Pos.y;
	}
	
	return mul(In.Pos,matWorldViewProj);
}

#define CUSTOM_PS_EMISSIVEMASK
float Custom_PS_EmissiveMask(vsOut In, float emissive)
{
	return vecSkill1.w;
}

#define CUSTOM_PS_EXTEND
#ifndef VECSKILL5
	#define VECSKILL5
	float4 vecSkill5;
#endif
psOut Custom_PS_Extend(vsOut InPs, psOut OutPs)
{
	//fetch output color and calculate clip value from it
	half clipValue = (dot(OutPs.AlbedoAndEmissiveMask.xyz,1)*vecSkill5.x)-1;
	//apply clipping
	clip(clipValue);
	
	//output clipvalue to emissive buffer for some nice glow on edges where clipping will occur in the near future
	OutPs.AlbedoAndEmissiveMask.w = (1-saturate(clipValue))*0.5;
	//set emissive color
	OutPs.AlbedoAndEmissiveMask.xyz = lerp(OutPs.AlbedoAndEmissiveMask.xyz, vecSkill5.yzw, pow(1-saturate(clipValue),2));
	
	return OutPs;
}


#include <scObject>



New living bloom SHADOW SHADER:
Code:
#include <scHeaderLightShadowmap>

#define CUSTOM_PS_EXTEND
#ifndef VECSKILL1
	#define VECSKILL1
	float4 vecSkill1;
#endif
#ifndef ENTSKIN1
#define ENTSKIN1
	texture entSkin1;
#endif
sampler colorSampler = sampler_state
{
	Texture = <entSkin1>;
	AddressU = WRAP;
	AddressV = WRAP;
};
psOut Custom_PS_Extend(vsOut InPs, psOut OutPs)
{
	half clipValue = (dot(tex2D(colorSampler, InPs.Tex).rgb,1)*vecSkill1.x)-1;
	clip(clipValue);

	return OutPs;
}

#include <scLightShadowmap>




CHANGED 05.c
Code:
/***************************************************************************

Basic Example on how to use write and use custom materials/shaders

***************************************************************************/

#include <litec.h>
#include <acknex.h>
#include <default.c>

//#define DEBUG_PSSM

//include Shade-C
#define PRAGMA_PATH "shadec"
#include "shade-c.h"

#include "common.h"


void setupMaterial()
{
	//convert skills to floats so they can be used in the shader
	mtl.skill1 = floatv(mtl.skill1);
	mtl.skill2 = floatv(mtl.skill2);
	mtl.skill3 = floatv(mtl.skill3);
	mtl.skill4 = floatv(mtl.skill4);
	
	
	//after setting everything up, switch to Shade-C's material event.
	// !! THIS IS IMPORTANT !!
	mtl.flags = ENABLE_RENDER;
	mtl.event = sc_materials_event; 
}

MATERIAL* mtlTexMove =
{
	//this effect adds texture movement
	effect = "05_animatedTexture.fx";
	flags = ENABLE_RENDER;
	event = setupMaterial;
	skill1 = 0.1; //texture movement speed in x direction
	skill2 = 0.8; //texture movement speed in y direction
	
	power = 25;
}

MATERIAL* mtlLivingBloom =
{
	//this effects moves the vertexes of the model around
	//it also adds the whole model to the emissive buffer, which will make the object glow
	effect = "05_livingBloom.fx";
	flags = ENABLE_RENDER;
	event = setupMaterial;
	skill1 = 0.25; // x vertex movement strength
	skill2 = 0.25; // y vertex movement strength
	skill3 = 0.1; // movement speed
	skill4 = 0.1; // glow strength
	
	skill5 = 10; //dissolve value, the lower this gets, the more of the object will be dissolved
	skill6 = 1; //emissive color red
	skill7 = 0.5; //emissive color green
	skill8 = 0.25; //emissive color blue
	
	power = 25;
	
}
MATERIAL* mtlLivingBloomShadow =
{
	//this effect does the same as the effect above, but this time its for the shadowmap shader
	effect = "05_livingBloomShadow.fx";
}

MATERIAL* mtlDissolve =
{
	//this effect dissolves/desintegrates the object
	//it also adds emissive color to parts where desintegration will occur next
	effect = "05_dissolve.fx";
	flags = ENABLE_RENDER;
	event = setupMaterial;
	skill1 = 10; //dissolve value, the lower this gets, the more of the object will be dissolved
	skill2 = 1; //emissive color red
	skill3 = 0.5; //emissive color green
	skill4 = 0.25; //emissive color blue
	
	power = 25;
}
MATERIAL* mtlDissolveShadow =
{
	//this effect does the same as the effect above, but this time its for the shadowmap shader
	effect = "05_dissolveShadow.fx";
}



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

//simple camera script...
void v_camera()
{
	set(my,INVISIBLE);
	set(my,PASSABLE);
	while(1)
	{
		c_move(my,vector(key_force.y*25*time_step,-key_force.x*25*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);
	}
}

void main()
{
	shadow_stencil = -1; //turn off all engine intern shadow calculations. THIS IS IMPORTANT!
	level_load("05.wmb");
	wait(3); //wait for level load
	//set suncolor to zero (setting sun_color in WED to zero does NOTHING! This is a bug in gamestudio)
	//if suncolor == 0, sun will not be rendered. Set this for pure indoor scenes to boost performance!
	vec_set(sun_color, vector(0,0,0)); 
	//sun_angle.pan = 45;
	//vec_set(sun_color, vector(255,240,230));
	//set ambient color to zero as we want a dark level with nice shadows ;)
	vec_set(ambient_color, vector(0,0,0));
	//vec_set(ambient_color, vector(96,96,96));

	//create a camera object so we can move around the scene
	you = ent_create(NULL, vector(-800,0, 200), v_camera);
	you.tilt = -10;
	camera.clip_far = 5000; //set this as low as possible to increase performance AND visuals!
	
	//set resolution before calling sc_setup
	//if you want to change resolution again, simple call sc_setup() again after you changed the resolution
	//video_set(1280, 720, 0, 2);
	video_set(800, 600, 0, 2);
	
	//setup skies
	sc_sky(skycube);
	
	//set camera as main view of sc_screen_default
	sc_screen_default = sc_screen_create(camera);
	
	//enable/disable Shade-C effects. You have to set these before calling sc_setup()
	//If you want to change these during runtime, simply call sc_setup() again after you enabled/disabled an effect
	// -> more info in sc_core.h, in struct SC_SETTINGS
	sc_screen_default.settings.hdr.enabled = 1; //enable Bloom/HDR
		
	//initialize shade-c, use default screen object
	sc_setup(sc_screen_default);
	
	//tweak effect parameters anytime you want
	// -> more info in sc_core.h, in struct SC_SETTINGS
	sc_screen_default.settings.hdr.brightpass = 0.85;
	sc_screen_default.settings.hdr.intensity = 2;
	sc_screen_default.settings.hdr.lensflare.brightpass = 0.0;
	sc_screen_default.settings.hdr.lensflare.intensity = 0.25;
	
	//Add objects and apply custom materials
	//Texture Movement
	you = ent_create("vloga.mdl", vector(-200,0,60), NULL);
	vec_scale(you.scale_x, 0.5);
	you.material = mtlTexMove;
	set(you, SHADOW);
	
	//Living Bloom Thingy
	you = ent_create("vloga.mdl", vector(200,-300,60), NULL);
	ENTITY* livingBloomObject= you;
	vec_scale(you.scale_x, 0.5);
	you.material = mtlLivingBloom;
	set(you, SHADOW);
	//we have to set a custom shadowmap shader for this object, as the object's vertices are changed by the living bloom shader
	sc_skill(you, SC_OBJECT_MATERIAL_SHADOWMAP, mtlLivingBloomShadow);
	livingBloomObject.skill5 = 4;
	
	//Dissolve
	ENTITY* dissolveObject = ent_create("vloga.mdl", vector(0,200,60), NULL);
	vec_scale(dissolveObject.scale_x, 0.5);
	dissolveObject.material = mtlDissolve;
	set(dissolveObject, SHADOW);
	//we have to set a custom shadowmap shader for this object, as the object's alpha is changed by the dissolve shader
	sc_skill(dissolveObject, SC_OBJECT_MATERIAL_SHADOWMAP, mtlDissolveShadow);
	dissolveObject.skill1 = 4; //this one will be counted to zero in a loop. The resulting value will then be passed to the dissolve shader
	
	while(1)
	{
		//animate dissolve effect
		dissolveObject.skill1 -= time_step*0.05;
		if(dissolveObject.skill1 <= 0) dissolveObject.skill1 = 7;
		dissolveObject.material.skill1 = floatv(dissolveObject.skill1);
		
		livingBloomObject.skill5 -= time_step*0.05;
		if(livingBloomObject.skill5 <= 0) livingBloomObject.skill5 = 7;
		livingBloomObject.material.skill5 = floatv(livingBloomObject.skill5);
		wait(1);
	}
}



Thanks for your feedback laugh
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 01/08/13 19:53

Quote:
@Kartoffel: I'll compile a list with all possible hooks. I'll also implement a way to change the input and outputs of the vertexshader and pixelshader as i think you'll need the viewDir which currently isn't generated anywhere laugh
About the depth: It's rendered in the object shader, as well as the normals, emissive...well everthing which will be put in the gBuffer. There is no second view used to generate the gBuffer.
Good to know.

Yes, for relief-mapping I need ViewDir and the 3x3 Tangent mat (should be already avaiable because normalmapping needs this).
I think I'll use the alpha channel of the diffuse texture as heightmap since alpha doesn't work with deferred lighting.

oh and, anything new about the implementation of my hdr-mod? tongue
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 01/09/13 15:58

Added some (very spartanic) info in how to create your own custom shaders as well as how to extend them with your own code.

https://github.com/BoHHavoc/ShadeC-EVO/wiki

@Kartoffel: I started implementing your code some days ago laugh

[edit] New Update
Quote:
Added ability to set ubershader compile target
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 01/09/13 17:29

Thank you very much for the very spartanic information grin

...but I've got some problems smirk
there are defines like '#define CUSTOM_PS_DIFFUSE' to replace the default functions but the reliefmapping
changes color, alpha, normalmap and depth - all based on a ray intersection.

Do I really have to use one custom function for every single of these?

The problem is that they all need the depth information and doing the intersection
for color, alpha, normalmap and depth is just too inefficient confused

another thing is that this:
Code:
#define CUSTOM_VS_OUTPUT_EXTEND float3 ViewDir : TEXCOORD5; // View Direction, needed for relief mapping

[...]

float4 Custom_PS_Diffuse(vsOut In, half3 skinAlbedo)
{
   float4 Color = 0;
   
   In.ViewDir = normalize(In.ViewDir);

...results in an 'invalid subscript "ViewDir"' - Error

Quote:
@Kartoffel: I started implementing your code some days ago laugh
nice laugh
btw. I made slight changes at the tonemapping and added a bleach-bypass effect to it.
It still needs some optimization but if you think it's worth implementing this modification I'll send it to you when I'm finished
Posted By: rojart

Re: Shade-C v0.91 BETA S1 RELEASED - 01/10/13 11:49

Thanks for explanation, I'll check it later.

Originally Posted By: BoH_Havoc
...
Level maps dosen't works with normalmaps for now, they is a shader levelDefaultNM.fx implemented but without any effect?

They do work. Have a look at common.h "mtl_levelDefaultNM". The levelmaps in the examples have this shader applied. It's just that the normalmaps aren't that strong in the example and therefor the effect might not be visible at first glance.
...

One thing makes me problems. Please check this file.
I noticed that the Level normalmaps only works if I added the default WED light?

Without default light:



With default light:



Thanks again for updates and wiki!

PS.
Manual as chm would be very useful, too. laugh
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 01/10/13 14:52

Small Update:
Quote:
Added CUSTOM_PS_TEX hook up


Quote:

...but I've got some problems
there are defines like '#define CUSTOM_PS_DIFFUSE' to replace the default functions but the reliefmapping
changes color, alpha, normalmap and depth - all based on a ray intersection.

Do I really have to use one custom function for every single of these?

The problem is that they all need the depth information and doing the intersection
for color, alpha, normalmap and depth is just too inefficient


I made a small update which lets you customize the In.Tex.xy in the PixelShader. That way you just have to worry about moving the texcoords around in your custom Parallax Shader and everything else will be done by the ubershader. laugh
Use CUSTOM_PS_TEX , float4 Custom_PS_Tex(vsOut In) to access. XY fetches the model's skins, ZW fetches the static shadowmap applied to the model (if there is one) (not implemented yet, will be in a future update).


Quote:

another thing is that this:
Code:
#define CUSTOM_VS_OUTPUT_EXTEND float3 ViewDir : TEXCOORD5; // View Direction, needed for relief mapping

[...]

float4 Custom_PS_Diffuse(vsOut In, half3 skinAlbedo)
{
float4 Color = 0;

In.ViewDir = normalize(In.ViewDir);

...results in an 'invalid subscript "ViewDir"' - Error




Works for me, make sure you are putting the #define CUSTOM_VS_OUTPUT in the correct place laugh
Code:
#define CUSTOM_VS_OUTPUT_EXTEND float3 ViewDir : TEXCOORD7;

#include <scHeaderObject>

<your code here>

#include <scObject>



Also please don't use TEXCOORD5 if TEXCOORD7 and TEXCOORD6 are still empty. I MIGHT change the ubershader in the future and MIGHT make use of TEXCOORD5 then. By using TEXCOORD7 or TEXCOORD6 the chance is higher that your shader will still work with future updates without giving an error about TEXCOORD5 already in use wink.
If you are using TEXCOORD7 and TEXCOORD6 already then yes: You have to use TEXCOORD5 for additional data.


Quote:

One thing makes me problems. Please check this file.
I noticed that the Level normalmaps only works if I added the default WED light?

Without default light:



With default light:




Interesting... i'll have a look at it.
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 01/10/13 15:00

Again, thanks a lot for all the info (and the custom tex-coord hookup) laugh
I'll try to get it working now

The last thing I don't know how to do is how to correct the depth so that SSAO, shadows and lighting are calculated correctly on the surface.
A little workaround should do this but that's not very important right now.

EDIT: sorry, but I've got another question smirk : what are the texture-samplers' names?
...ok I've got it. Just had to look into default.fx laugh
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 01/31/13 17:07

Some news:

1)
Implemented support for transparent objects in the deferred renderer (= objects will react to deferred lights, shadows, etc) for a client. At the moment it only supports 1 Layer of transparency, so if there are 2 windows in the scene, overlapping each other, only the nearest window will be visible. This sounds bad at first, but in practice you won't notice it at first glance. I might extend this to support 3-4 layers in the future.
(Oh and i finally fixed the window textures for the car...)



This still needs a bit of work, as it could be faster and there are small 1 pixel errors sometimes, but all in all it works laugh
This also paves the way for a water renderer which correctly behaves to all the lighting going on


2)
It's that time of the year again: University calls. There won't be much updates from my side for the next 1 1/2 months. I'll try to get kartoffel's hdr (finally!) and transparency finished during that time though.
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 01/31/13 17:22

You´re awesome!! laugh
Posted By: REZ

Re: Shade-C v0.91 BETA S1 RELEASED - 01/31/13 18:09

looks really cool !!!
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 01/31/13 18:44

Quote:
I'll try to get kartoffel's hdr (finally!) and transparency finished during that time though.

Is there a way to support real HDRR (floating-point textures as render targets)?
I'm asking 'cause I'm currently working (actually it's finished now) on a high quality bloom with HDRR support.
Posted By: lostclimate

Re: Shade-C v0.91 BETA S1 RELEASED - 01/31/13 19:42

very cool... although that is an awfully well polished pallet ya got there wink
Posted By: ratchet

Re: Shade-C v0.91 BETA S1 RELEASED - 01/31/13 22:01

There won't be much updates from my side for the next 1 1/2 months

No idea to make it public for some parts and some expert shaders to work on it ?
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 RELEASED - 02/22/13 21:05

Hi there,

its a long time since i was here. One question. Is there a manual for Shade-C Evo like for the shade-c 0.91 Beta? (I have not worked with it for several years.)

BTW: Great work Havoc!

Schmerzmittel


EDIT Sagt:
Hm...i get error messages if i run the examples of shade-c. If i define SC_A7 i get message that a error is in line 1103 from sc_lights.c. pssm_splitdist' undeclared identifier

What does it mean? I run A7 Commercial 7.86.6
I really want to use the new Shade c
Posted By: Anonymous

Re: Shade-C v0.91 BETA S1 RELEASED - 02/25/13 09:57

Originally Posted By: Schmerzmittel

One question. Is there a manual for Shade-C Evo like for the shade-c 0.91 Beta? (I have not worked with it for several years.)

No. Havoc wrote the first 2 Chapters in the wiki but thats it so far.

Originally Posted By: Schmerzmittel

Hm...i get error messages if i run the examples of shade-c. If i define SC_A7 i get message that a error is in line 1103 from sc_lights.c. pssm_splitdist' undeclared identifier

What does it mean? I run A7 Commercial 7.86.6
I really want to use the new Shade c

that is because Hacoc, cant blame him, does not focus soo much on the A7 support as i thought im the only one useing A7 and Shade-C laugh
fast fix for the problem would be to just comment the line out and run it. It does work after that without visual errors as far as i could tell.
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 02/26/13 17:57

Is there a way to get shadows for point lights (moving one as well)? Using:
Quote:
SC_LIGHT_P | SC_LIGHT_SHADOW
Doesn't work. BTW, I would like to be able to make all this kind of lines:
Code:
sc_light_create(vector(my.x, my.y, my.z), 250, vector(my.skill1,my.skill2,my.skill3), SC_LIGHT_P | SC_LIGHT_SHADOW, vector(my.pan, my.tilt, my.roll), my.skill5);

Shorter. So they look maybe like this:
Code:
sc_light_create(my.x, 250, my.skill1, SC_LIGHT_P | SC_LIGHT_PROJECTION, my.pan, my.skill5);

But this won't work as well, will lead to compiler error (wrong parameters).
Posted By: Uhrwerk

Re: Shade-C v0.91 BETA S1 RELEASED - 02/26/13 19:08

Code:
sc_light_create(&(my.x), 250,&(my.skill1), SC_LIGHT_P | SC_LIGHT_PROJECTION,&(my.pan), my.skill5);


should do the trick.
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 02/26/13 19:43

Uhrwerk@ thats awesome man, thanks a lot. I didn't really knew about inserting "&" before defining the vector
Posted By: Uhrwerk

Re: Shade-C v0.91 BETA S1 RELEASED - 02/26/13 20:15

That's because you're used to the dowzy Lite-C syntax checking. "&" is the address operator. It does not have anything to do with vectors in the first place.
Posted By: Schmerzmittel

Re: Shade-C v0.91 BETA S1 RELEASED - 03/01/13 18:53

Thanks. Now it is running perfectly.

But is it possible to have more than one Projection texture? Oh...and i miss the Luminancemask from 0.91c.

EDIT:
I used your Point light snippet, but it don't work. It says, "wrong parameter". Or does this not work with A7?
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 03/15/13 16:52

hi,
any news on terrain and water implementation?
thanks.
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 03/18/13 15:46

...and is there any workaround in shadec 90 or 91b for the water reflection offset that can be seen in case on 16:9 screens. apparently it is camera.tilt and camera.z dependent...

Edit: don't worry, I solved it laugh
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 03/21/13 09:37

..what I still don't know how to set properly foam for water (in shade-c 0.90 or 0.91b). it looks ugly for me, not like in the 0.90 demo where it appears nicely only at shore. any idea? thanks.

Edit: okay, found the problem again. fog caused the problems.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 03/21/13 17:43

ohhh MANNSS. I'm really impressed. was a long time that I was not monitoring the topic. Literally I was amazed to see the level of SHADE-C currently quality.
TANKS HAVOC!
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 03/21/13 19:50

has a documentation? There are many resources to be used but I do not even know where to start!
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 03/23/13 08:45

the old 0.90 has a short chm manual, later there are examples to check only.
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 03/23/13 10:18

At the moment there are only information about custom shaders.
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 03/27/13 10:02

at 'User Resources' section I just presented Shade-C 0.90 water conversion for A8, including support for 16:9 screens.
and of course, thanks BoH_Havoc for this great collection!
Posted By: oliver2s

Re: Shade-C v0.91 BETA S1 RELEASED - 03/28/13 12:58

Why does the framerate drops down with using Shade-C, even if there's an empty level (and deactivated effetcs like HDR, PSSM, SSAO, etc..)?
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 04/05/13 11:08

Quote:
Is there a way to support real HDRR (floating-point textures as render targets)?
I'm asking 'cause I'm currently working (actually it's finished now) on a high quality bloom with HDRR support.


I will implement a switch for this to either create 32bpp, 64bpp or 128bpp rendertargets. Please note though, that i will always try to keep the default value at 32bpp in order to support older hardware.



Quote:
Is there a way to get shadows for point lights (moving one as well)? Using:


Pointlights can't cast shadows at the moment. While it is trivial to add shadow support for pointlights and it is also rather easy to make it look good, it is absolutely NOT trivial to make it performant. I have an idea how to implement shadows for pointlights in a fast way, but it hasn't been a high priority at the moment.



Quote:
But is it possible to have more than one Projection texture? Oh...and i miss the Luminancemask from 0.91c.


Only one projection texture per light. Luminancemask also made it into Shade-C EVO. Use:
Code:
#define SKIN_EMISSIVEMASK (skin3.x)
#define EMISSIVEMASK


in the shader to activate it (skin3.x defines where the emissivemask is located. You can change that to your liking) and also add either
Code:
#define EMISSIVE_A7


to set emissivecolor by material.emissive_red , material.emissive_red and material.emissive_red
or
Code:
#define EMISSIVE_SHADEC


to set emissivecolor by sc_skill(entity, SC_OBJECT_EMISSIVE, vector(red, green, blue));.



Quote:
any news on terrain and water implementation?

While writing my masterthesis i also did some research on terrain shaders and how to keep them fast. There will be a terrainshader in the near future. About water: I have thought about some ways, but am not completly sure on how to implement it yet. Again, this is a matter of performance instead of "just" making it look good.



Quote:
Why does the framerate drops down with using Shade-C, even if there's an empty level (and deactivated effetcs like HDR, PSSM, SSAO, etc..)?

Shade-C uses deferred rendering. The initial setup "costs" more than in a traditional forward rendering setup. Even if there is nothing on the screen and no pp effects are activated, a lot is going on behind the scenes. The scene is renderet into 4 render targets by using MRTs, these MRTs are then processed, lighting is added and finally everything is added together. It doesn't matter if there are objects on the screen or not, these steps always need to be done. After these initial costs, deferred rendering is often faster than traditional forward rendering. It depends on the type of game you are creating though. If you only have one directional light in your level and no other lights, forward rendering will most likely be faster. If you add in shadows for the directional light, deferred rendering might or might not be faster (hybrid methods also exist were only shadows are deferred). If you have lots of lights and shadows in your game, deferred rendering is the way to go. Roughly speaking, deferred rendering speed depends on the screen resolution while forward rendering speed depends on the number of objects/lights drawn. Forward, deferred and hybrid rendering all have their pros and cons.



News:
- No news for Shade-C.
- Finished my paper "Power to the players: Developing a large scale MMORPG on a tight budget".
- Currently working on creating a company together with 3 other guys and finishing my course of studies as well as prototyping various (mobile) games as launch titles for the company.
- in general: much do to at the moment.
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 04/05/13 12:20

Quote:
Pointlights can't cast shadows at the moment. While it is trivial to add shadow support for pointlights and it is also rather easy to make it look good, it is absolutely NOT trivial to make it performant. I have an idea how to implement shadows for pointlights in a fast way, but it hasn't been a high priority at the moment.
hmm... what I'd try: A single view without frustum culling and a shader which renders the scene 6 times (for each side) using the vertex shader to transform the scene to the right orientation.
Edit: or dual paraboloid shadow mapping, but I don't know how to get it working properly.
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 04/05/13 12:22

thanks, I know a fast and nice water shader is not simplistic at all...
I hope the terrain shader can be ready soon.
I simply need terrain and water to switch to Shade-C EVO.
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 04/11/13 06:59

Hey Havoc, i´ve got a problem here.
If i activate the forward rendering then everything gets a blue color.
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 04/11/13 17:03

I have a relatively complicated shader I want to include in my project and share for Shade-C. Would anyone be able to help me get this to work? I am not shader knowledgeable so this is kind of difficult for me. I'm not asking for someone to completely get the coding done FOR me, just looking to see if someone can point me in the right direction.

Click to reveal..

//==========================================//
#define COLORMAP_TEXTURE entSkin1
//#define NORMALMAP_TEXTURE entSkin2
//#define INTENSMASK_TEXTURE entSkin3

#define LIGHTGRADIANT_TEXTURE mtlSkin1
//==========================================//

//#define USE_TS_NORMALMAPPING
//#define USE_OS_NORMALMAPPING
//#define USE_SECOND_UVSET_FOR_NORMALMAPPING

//===================//

//#define USE_COLOR_INTENSITY_SHIFT
//#define USE_COLOR_INTENSITY_MASK

const float max_colorintensity=4;

const float max_sunintensity=1.1;
const float min_sunintensity=0.1;

//===================//

#define USE_OUTLINES
#define USE_PIXELSIZED_OUTLINES
#define USE_COLORED_OUTLINES

const float outline_thickness=1;
const float3 outline_color=float3(0.5,0.6,0.8);//RGB in range 0..1 (instead of 0..255)

//===================// requires USE_COLORED_OUTLINES:

//#define USE_LIGHTING_ON_OUTLINES
#define USE_TEXTURED_OUTLINES
//#define USE_ALPHA_FOR_OUTLINES

const float texoutline_brightness=0.55;//0..darker..1..brighter..
const float texoutline_intensity=1;//0..less..1..more..
//==========================================//

bool AUTORELOAD;

float4x4 matWorldViewProj;
float4x4 matWorld;
float4x4 matWorldView;
float4x4 matView;

float4 vecSunDir;
float4 vecSunColor;
float4 vecViewPort;

texture entSkin1;
texture entSkin2;
texture entSkin3;
texture entSkin4;

texture mtlSkin1;
texture mtlSkin2;
texture mtlSkin3;
texture mtlSkin4;

sampler COLOR_SAMPLER = sampler_state { Texture = <COLORMAP_TEXTURE>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = clamp; AddressV = clamp; };
sampler LGRAD_SAMPLER = sampler_state { Texture = <LIGHTGRADIANT_TEXTURE>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = clamp; AddressV = clamp; };

#if defined(USE_TS_NORMALMAPPING) || defined(USE_OS_NORMALMAPPING)
sampler BUMP_SAMPLER = sampler_state { Texture = <NORMALMAP_TEXTURE>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = clamp; AddressV = clamp; };
#endif

#ifdef USE_COLOR_INTENSITY_SHIFT
#ifdef USE_COLOR_INTENSITY_MASK
sampler MASK_SAMPLER = sampler_state { Texture = <INTENSMASK_TEXTURE>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = clamp; AddressV = clamp; };
#endif
#endif

////////////////////////////////////////////
#ifndef USE_COLORED_OUTLINES
#undef USE_LIGHTING_ON_OUTLINES
#undef USE_TEXTURED_OUTLINES
#undef USE_ALPHA_FOR_OUTLINES
#endif

#ifdef USE_ALPHA_FOR_OUTLINES
#define USE_TEXTURED_OUTLINES
#endif

#ifdef USE_TS_NORMALMAPPING
#undef USE_OS_NORMALMAPPING
#else
#ifdef USE_OS_NORMALMAPPING
#undef USE_TS_NORMALMAPPING
#endif
#endif

#if defined(USE_TS_NORMALMAPPING) || defined(USE_OS_NORMALMAPPING)
#define USE_NORMALMAPPING
#else
#undef USE_SECOND_UVSET_FOR_NORMALMAPPING
#endif
////////////////////////////////////////////
void VS(
in float4 vPos : POSITION,
in float3 normal : NORMAL,
in float2 InTex : TEXCOORD0,

#ifdef USE_SECOND_UVSET_FOR_NORMALMAPPING
in float2 InTex2 : TEXCOORD1,
#endif

#ifdef USE_TS_NORMALMAPPING
in float4 InTangent : TEXCOORD2,
#endif

out float2 OutTex : TEXCOORD0,

#ifdef USE_SECOND_UVSET_FOR_NORMALMAPPING
out float2 OutTex2 : TEXCOORD2,
#endif

#ifndef USE_NORMALMAPPING
out float3 outnormal : TEXCOORD1,
#else
#ifdef USE_TS_NORMALMAPPING
out float3 SunDir : TEXCOORD1,
#endif
#endif

out float4 Pos : POSITION
)
{

#ifndef USE_NORMALMAPPING
outnormal=mul(normal,matWorld);
#else
#ifdef USE_TS_NORMALMAPPING
float3x3 matTangent;

matTangent[0] = mul(InTangent.xyz,matWorld);
matTangent[1] = mul(cross(InTangent.xyz,normal),matWorld)*InTangent.w;
matTangent[2] = mul(normal,matWorld);

SunDir = normalize(mul( matTangent,vecSunDir.xyz));
#endif
#endif

Pos = mul(vPos,matWorldViewProj);

OutTex = InTex;

#ifdef USE_SECOND_UVSET_FOR_NORMALMAPPING
OutTex2 = InTex2;
#endif
}

void PS(
in float2 Tex : TEXCOORD0,

#ifdef USE_SECOND_UVSET_FOR_NORMALMAPPING
in float2 Tex2 : TEXCOORD2,
#endif

#ifndef USE_NORMALMAPPING
in float3 normal : TEXCOORD1,
#else
#ifdef USE_TS_NORMALMAPPING
in float3 SunDir : TEXCOORD1,
#endif
#endif

out float4 COL :COLOR0
)
{

#ifndef USE_NORMALMAPPING
normal = normalize(normal);
#else
#ifdef USE_TS_NORMALMAPPING
vecSunDir.xyz = normalize(SunDir);
#ifndef USE_SECOND_UVSET_FOR_NORMALMAPPING
float3 normal = normalize(tex2D(BUMP_SAMPLER,Tex).xyz*2.f-1.f);
#else
float3 normal = normalize(tex2D(BUMP_SAMPLER,Tex2).xyz*2.f-1.f);
#endif
#else
matWorld[3]=float4(0,0,0,1);
#ifndef USE_SECOND_UVSET_FOR_NORMALMAPPING
float3 normal=normalize(mul(float4(tex2D(BUMP_SAMPLER,Tex).xyz*2.f-1.f,0),matWorld)).xzy;
#else
float3 normal=normalize(mul(float4(tex2D(BUMP_SAMPLER,Tex2).xyz*2.f-1.f,0),matWorld)).xzy;
#endif
normal.z*=-1.f;
#endif
#endif

COL = tex2D(COLOR_SAMPLER,Tex);

float sun_blub=dot(vecSunDir,normal)*0.5f+0.5f;

float sun_diff=tex1D(LGRAD_SAMPLER,sun_blub);
sun_diff=lerp(min_sunintensity,max_sunintensity,sun_diff);

#ifdef USE_COLOR_INTENSITY_SHIFT

#ifdef USE_COLOR_INTENSITY_MASK
COL.rgb=lerp(COL.rgb,pow(COL.rgb,lerp(max_colorintensity,1,min(1,sun_diff))),tex2D(MASK_SAMPLER,Tex));
#else
COL.rgb=pow(COL.rgb,lerp(max_colorintensity,1,min(1,sun_diff)));
#endif

#endif

COL.rgb=COL.rgb*sun_diff;//*vecSunColor;
//COL=normal.y;
COL.a=1;
}

#ifdef USE_OUTLINES
void VS_OUTLINES(
in float4 vPos : POSITION,
in float3 normal : NORMAL,

#ifdef USE_TEXTURED_OUTLINES
in float2 InTex : TEXCOORD0,
out float2 OutTex : TEXCOORD0,
#endif

#ifdef USE_LIGHTING_ON_OUTLINES
out float3 outnormal : TEXCOORD1,
#endif

out float4 Pos : POSITION
)
{
#ifdef USE_PIXELSIZED_OUTLINES
float3 viewnormal=mul(normal,matWorldView);

Pos = mul(vPos,matWorldViewProj);

float2 sTex=(Pos.xy/Pos.w)*0.5f+0.5f;

sTex+=viewnormal.xy*outline_thickness*vecViewPort.zw;

Pos.xy=(sTex*Pos.w*2.f-Pos.w);
#else
Pos = mul(float4(vPos.xyz+normal*outline_thickness*0.2f,1),matWorldViewProj);
#endif

#ifdef USE_TEXTURED_OUTLINES
OutTex = InTex;
#endif

#ifdef USE_LIGHTING_ON_OUTLINES
outnormal=mul(normal,matWorld);
#endif
}

#ifdef USE_COLORED_OUTLINES

void PS_OUTLINES(
#ifdef USE_TEXTURED_OUTLINES
in float2 Tex : TEXCOORD0,
#endif

#ifdef USE_LIGHTING_ON_OUTLINES
in float3 normal : TEXCOORD1,
#endif

out float4 COL :COLOR0
)
{
COL.a=1;

#ifdef USE_TEXTURED_OUTLINES
COL = tex2D(COLOR_SAMPLER,Tex);
#else
COL.rgb=outline_color;
#endif

#ifdef USE_LIGHTING_ON_OUTLINES
normal = normalize(normal);

float sun_blub=dot(vecSunDir,normal)*0.5f+0.5f;

float sun_diff=tex1D(LGRAD_SAMPLER,sun_blub);
sun_diff=lerp(min_sunintensity,max_sunintensity,sun_diff);

#ifdef USE_COLOR_INTENSITY_SHIFT

#if defined(USE_COLOR_INTENSITY_MASK) && defined(USE_TEXTURED_OUTLINES)
COL.rgb=lerp(COL.rgb,pow(COL.rgb,lerp(max_colorintensity,1,min(1,sun_diff))),tex2D(MASK_SAMPLER,Tex));
#else
COL.rgb=pow(COL.rgb,lerp(max_colorintensity,1,min(1,sun_diff)));
#endif

#endif

COL.rgb=COL.rgb*sun_diff;//*vecSunColor;
#endif

#ifdef USE_TEXTURED_OUTLINES
#ifndef USE_ALPHA_FOR_OUTLINES
COL.rgb=pow(COL.rgb,texoutline_intensity)*texoutline_brightness;
#endif
#endif

#ifndef USE_ALPHA_FOR_OUTLINES
COL.a=1;
#endif
}
#endif
#endif

technique Shading
{
pass P0
{
zenable=true;
zwriteenable=true;
alphablendenable=false;
alphatestenable=true;

AlphaRef=0;
AlphaFunc=Greater;

VertexShader = compile vs_2_0 VS();
PixelShader = compile ps_2_0 PS();
}

#ifdef USE_OUTLINES
pass Outlines
{
cullmode=cw;
VertexShader = compile vs_2_0 VS_OUTLINES();


#ifdef USE_ALPHA_FOR_OUTLINES
zenable=true;
zwriteenable=true;
alphablendenable=false;
alphatestenable=true;

AlphaRef=0;
AlphaFunc=Greater;
#endif


#ifdef USE_COLORED_OUTLINES
PixelShader = compile ps_2_0 PS_OUTLINES();
#endif
}
#endif
}



I am also having an issue where at the start of a level the shadows start kind of "dissolving". any reason or fix for that?
Posted By: BoH_Havoc

Re: Shade-C v0.91 BETA S1 RELEASED - 04/14/13 11:02

Quote:
Edit: or dual paraboloid shadow mapping, but I don't know how to get it working properly.


I used them in the past, but they aren't really worth it. Actually they are worse than doing traditional cubemapping. Apart from the seam that appears between the two paraboloid maps, they are also not as good to optimize. With cubemapping you have 6 views with a "relatively" small area to render. With dual paraboloidmapping you have 2 views rendering everything. Using 6 views, you can turn off 2-3 most of the time to save bandwith and drawcalls, whereas with dual paraboloidmapping you end up leaving both views on in most cases.

Quote:
Hey Havoc, i´ve got a problem here.
If i activate the forward rendering then everything gets a blue color.

Make sure you have a skycube in your scene and set it up with sc_sky(skyentity);
If you don't have a skycube, create a dummycube and set that up. The blue you see is the camera clear color.

Quote:
I have a relatively complicated shader I want to include in my project and share for Shade-C. Would anyone be able to help me get this to work? I am not shader knowledgeable so this is kind of difficult for me. I'm not asking for someone to completely get the coding done FOR me, just looking to see if someone can point me in the right direction.


You want to extend the default Shade-C Object shader. Look here for more information on how to do that:
Custom Shaders (Advanced)
Custom Shaders (Beginner)

It might be more easy to write down the features of your shader though and re-implement it instead of porting it. Shade-C already comes with a lot of features you can use to start building your own shader. For example normalmapping and specular lighting is already supported and you don't have to re-implement it, as well as emissive lighting,colormasks and a few other things.

Also, have a look at the shadec/examples/fx folder as well as shadec/examples/05.c . There's a bunch of custom shaders in there that should get you started.

Quote:
I am also having an issue where at the start of a level the shadows start kind of "dissolving". any reason or fix for that?

Can you post a screenshot?
Posted By: exile

Re: Shade-C v0.91 BETA S1 RELEASED - 04/14/13 20:52

I can do one better actually, here's a video of what happens

http://www.youtube.com/watch?v=bjyVV8QvXhc
Posted By: alibaba

Re: Shade-C v0.91 BETA S1 RELEASED - 04/15/13 13:32

Why causes an increasing of camera.clip_far such artifacts?
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 04/15/13 13:59

I think some shade-c values are affected by the clip-values and they probably don't update automatically if you change clip_far manually.
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 04/15/13 16:45

alibaba@ try to update the shadec by calling sc_setup
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 09:43

a quick question: are the shade-c 0.91 shadows faster than the default pssm shadows of 3dgs (what I modified to be faster, but still not enough), in case of a lot of objects? if I read well it uses deferred shading.
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 09:49

sivan@ it was very fast for me, when I got it to work with A8 (long time ago, but I've lost the demo), but the problem was that it weren't supporting alpha textures (f.e. trees etc).
Posted By: PadMalcom

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 09:53

Neither does the standard PSSM shader smirk
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 09:56

thanks, I will check what it knows. trees can be excluded and have a static lightmap until I keep them in non-destructible category.
I'm sure finally I will need a deferred renderer to handle my targets: 1000 moving units, 1000 trees and 100 building entities, far camera views. curretnly I can produce acceptable results only with stencil shadows for units and buildings, and lightmap or decal shadows for others...

the standard pssm do not support only self shadows on alpha textures, but creates alpha supoorted shadows on other objects. is it the situation with shade-c 0.91 too?
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 10:15

Originally Posted By: sivan
the standard pssm do not support only self shadows on alpha textures, but creates alpha supoorted shadows on other objects. is it the situation with shade-c 0.91 too?
I far as I remember (it was a long time ago as I've said), it wasn't supporting alpha channel in anyways.
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 10:40

thanks. frown I will add it grin
Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 10:52

it's strange.. but I guess I got alpha channel to work as well (they were working from the beginning I guess) grin
Quote:
One:
Two:

Damn.. shade-c rocks so much! BoH_Havoc you are the MAN! You know, we all love you! laugh

Edit: as you can see, self shadow supports alpha channel as well! laugh
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 13:03

wow. what version is it, 0.91 or evo?
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 14:35

@sivan
the one 3run posted is .91
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 04/16/13 17:37

thanks!
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 04/18/13 14:11

the first trial is very promising, I'm satisfied with its quality and performance. thanks 3run again! I hope I'll get no significant fps drop in case of a lot of moving vertex animated entities... laugh

a few questions:
- can I use only the shade-c terrain shader with its shadowmapping, or is there any other shader out there without the need of quad textures that works fine? if I will put it into my editor I want to keep some compatibility with earlier versions, and easy usage. and probably I will need more textures to be blended...
- can single skin terrain detail map be shown? it disappears after material effect setup.
- is there an example to use it together with a tree wind animation shader?

@3run: your settings produced a messy shadow map, I had to use the default sc_smSunSetup(screen_size.x, 2000, 1000, 0.002, 0); to get this result.



Posted By: 3run

Re: Shade-C v0.91 BETA S1 RELEASED - 04/18/13 16:54

sivan@ yes, you are right, problem goes to the bluring value. use everything the same, but with low blurring value (0.001 f.e.).
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 04/19/13 14:02

another stupid question: does the v0.91 terrain shader natively support shadowmapping (type 0), or should I set something? (I see static lightmap is supported on blendmap alpha.)
I'm just in the very beginning of getting familiar with the terrain shader. laugh


okay, sorry, I found it in the shader.
Posted By: Arrovs

Re: Shade-C v0.91 BETA S1 RELEASED - 05/10/13 00:03

Any have got sc_materials_event() crash vhen using sc_entity creating functions? After many tests im pinpointed to sc_materials_event line:
pEffect->SetTexture("texNormalsAndDepth", screen.renderTargets.gBuffer[SC_GBUFFER_NORMALS_AND_DEPTH].d3dtex);

Its happening when turning on forward rendering flag(otherwise this event dont uses this case).

I really dont know what to do - no idea what this line do and how i could repair things. Is this line wrong or model which is set for this line?

I really hope any other could do some tests.
Posted By: 82RJZAE

Re: Shade-C v0.91 BETA S1 RELEASED - 05/25/13 20:50

Anyone know how to fix "error: 88760b59"?

EDIT: I found out that if I had the folder "shadec" in a subdirectory it would give me that error; I had to put "shadec" in my project directory. I even tried defining all the subfolders but it still gave me that error.

EDIT2: I seem to be getting a lot of errors when I open a level in WED. For example:

Invalid name:
sc_lights_shadowmapLocal.fx

Invalid name:
sc_lights_shadowmapBlur.fx

...

Invalid name:
sc_pp_explosionRefractScreen.fx

Any idea how to get rid of these? It would seem the names are too long perhaps?
Posted By: Arrovs

Re: Shade-C v0.91 BETA S1 RELEASED - 05/30/13 22:06

im receiving them myself. Could be nice if creator returns and helps us explain things. Overall i even send him message vith vish to help in development, but he still not respond.
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 05/31/13 08:40

I think in WED file names are usually max 15 character long, but not sure...
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 06/18/13 07:11

Houston, we have a problem!

I cannot get dynamic shadows on terrain when using the therrain shader.
should it work properly, and if yes, how? if I apply simply sc_obj_doShadow.fx it works fine, but of course only with one skin.

thanks.


EDIT: okay, I found the bug. just replace in terrain shader matMTl by matEffect3 everywhere.
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 06/19/13 13:16

another 2 problems I faced with, I would be happy if anybody could help me:

I cannot get dynamic softshadows. I mean shadowmapping is fine but not soft. the blurring does no blurring at all, something wrong somewhere... sc_vsmSunBlur.fx does something but the final result always a black or white output.

shadowmapping area in case of very high camera positions is not at right place or orientation, so fades out in a bad way.

thanks.


EDIT: problem 2 is more or less solved by using an entity of my own camera system instead of the default sun dummy entity.

edit2: I modified the vsmBlur shader, so now it works okay. maybe a pp stage should be added for (optional) further smoothing...
Posted By: Arrovs

Re: Shade-C v0.91 BETA S1 RELEASED - 06/25/13 15:21

Which version you here using? Just curious because i dont want to run in them.
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 06/25/13 17:22

0.91b-s1
(imo shade-c evo could have a new thread)
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 07/02/13 09:44

EDIT: sorry, solved again, in the water shader finalcolor required a .xyz at a certain place, but finally I rewrote a bit the end part to get better water than the original laugh
---------------------------

again a little problem, I rewrote object shaders to SM 3.0, to get better dynamic lights, but this results in incompatibility with the depth shader probably, resulting in wrong water, which becomes white at shores and next to objects in water where it should be transparent with foam - but only if these objects use sm 3.0.



I made a workaround, now water looks fine but a bit different, foam covers the full surface.



I would be happy if somebody could give me a hint how to resolve it to get the original appearance. depth and water shaders work only if sm 2.0 used for them. in the worst case I'll use it in this form laugh
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 07/04/13 09:27

just some info about why variance shadow mapping is not totally fine in shade-c (not in scientific language):

variance value = blurred(depthmap.x*depthmap.x) - blurred(depthmap.x)*blurred(depthmap.x)

the 0.91b variance shadow mapping by default works with bad blurring, because it uses only one channel for depth (actually depthmap.x), then blurred by a pp shader, then read by object pixel shaders. it is squared in the object pixel shaders just before calling the variance shadow mapping function.
by this approach you always get the same squared values, thus variance is always zero! thus can get only black or white pixels, i.e. the blurred areas are also result in totally shadowed pixels. I made a lerping afterwards with the original depthmap and finally got blurred shadows, but this is only a hack.

the right solution is to get the depth on one channel e.g. depthmap.r, and store its squared value on another channel e.g. depthmap.g, and then do the blurring both on depthmap.r and depthmap.g. this way if you get the square of blurred depthmap.r, it won't be the same as the squared and then blurred value stored in depthmap.g, thus variance won't be always zero as before, thus you can get correct sahdowmapping.

the main advantage of variance shadow mapping over PCF smoothing (like in the default PSSM shader), is its speed, because done directly once on depthmap, and not on screen pixels in the object pixel shaders.

I will implement it soon laugh
Posted By: Kartoffel

Re: Shade-C v0.91 BETA S1 RELEASED - 07/04/13 11:59

yeah, doing the pow(x, 2); in the shadow mapping function doesn't do anyting grin
(it's the comparision between the linear filtering of the depth and the squared depth, that is used to calculate the linear interpolation for the shadows -> no hard edges and blurring is possible)

...since it looks like you know pretty much about vsm: does the depthmap has to be in range [0 - 1] or doesn't the range matter at all?

Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 07/04/13 12:18

I'm just trying to undaerstand it by reading some articles and sample codes, and trying to get what they can get.
e.g. there is a nice example using 6 lightmaps and combining their shadows.

edit1:
but I'm a bit got stuck, as it does not work as I expected... and in the original depth shader it is commented out... need some further research, but I don't understand the distance calculations in shade-c...
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 07/04/13 18:45

probably it has to be 0..1. now I have an idea what I could do wrong. but anyway, an example code from GPU Gems 3 works, as an interim solution, unfortunately shows some peter panning...

Edit: the depthmap max depth value was too high, if it is lowered everything works fine, but for really soft edged shadows, and for eliminating shadow fade-outs at terrain-object contact area, my original hack is still required...
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 08/10/13 21:02

how do I configure shadec for models that use sprites, example: tree, bushes...?
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 08/11/13 12:01

in 0.91 the simplest to assign the sc_obj_doshadow.fx shader by effect_load to a material that is used by your vegetation models. soon I will publish some shaders I wrote working with shade-c using the 3dgs material properties really properly (the default doshadow uses a bit different lighting), supporting dynamic lights, and one with wind vertex animations for vegetation got from animtree.fx.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 08/12/13 13:18

The biggest problem I'm having in the opacity!
My vegetation models are appearing like a plate with green background eg!
Posted By: sivan

Re: Shade-C v0.91 BETA S1 RELEASED - 08/12/13 14:30

maybe you use shade-c evo. in 0.91 it works fine.
Posted By: NeoNeper

Re: Shade-C v0.91 BETA S1 RELEASED - 08/12/13 17:05

YEP. I USE Shadec Evo.
This version runs faster on my projects and also has the most beautiful effects.
I'll see how it works in 0.9 and I'll try to implement in EVO. Tankz Sivan. (^.^)
Posted By: markjosol

Re: Shade-C v0.91 BETA S1 RELEASED - 10/14/13 09:17

ON AND I DON'T WANT UNFAIR COMPETITION.






________________________________________________
Fifa Ultimate Team Coins
Posted By: oliver2s

Re: Shade-C v0.91 BETA S1 RELEASED - 10/22/13 17:50

Is there any chance to get a new version of EVO with transparancy support in the near future?
Posted By: rojart

Re: Shade-C v0.91 BETA S1 RELEASED - 10/26/13 18:36

Originally Posted By: 82RJZAE
Anyone know how to fix "error: 88760b59"?

EDIT: I found out that if I had the folder "shadec" in a subdirectory it would give me that error; I had to put "shadec" in my project directory. I even tried defining all the subfolders but it still gave me that error.

EDIT2: I seem to be getting a lot of errors when I open a level in WED. For example:

Invalid name:
sc_lights_shadowmapLocal.fx

Invalid name:
sc_lights_shadowmapBlur.fx

...

Invalid name:
sc_pp_explosionRefractScreen.fx

Any idea how to get rid of these? It would seem the names are too long perhaps?

Just started testing shadec-evo and I found some irregularities.

If you got something like this "error: 88760b59" after compiling, just copy the sc_deferredLighting_LUT.dds file to the work folder.

The name file is for now restricted to 19 characters.

@oliver2s: I'll ask him what's going on, because i need this also.
Posted By: BoH_Havoc

Shade-C EVO: Deferred Transparency (1-Layer) - 12/09/13 17:12

Uploaded a new version

Quote:

Added support for deferred transparency (1-layer)
Added setting to change g-buffer and lightbuffer bitdepth
Prepared pipeline for PBR
Fixed bug in specular lighting equation
Fixed tons of bugs


https://github.com/BoHHavoc/ShadeC-EVO

I might add Physically based rendering (PBR) in the near future, as i currently have a prototype running in Unity and porting it to Gamestudio shouldn't be to hard. It's based on the Unreal Engine 4 implementation and i have to say it looks pretty good in combination with dDo ( http://quixel.se/ddo/ ). laugh

Some news from my side:
I'll stop development of Shade-C in the not so distant future. One reason is that we dropped development of our inhouse game CSiS due to mayor bugs in gamestudio and/or our code and i no longer use gamestudio for other projects. CSiS was the only left.
The bigger reason however is this: Free time was very rare these past months and i doubt it will get better soon due to me and three other guys trying to get our company gentlymad on track ( http://gentlymad.org/game/inbetween ,there's a demo of our current game if you are interisted. It's not THAT bad, we came in 2nd place at German Multimedia Award 2013 and even got a live TV interview (SWR), radio interview (DasDing) and some newspapers also wrote about the game.).

I'm currently checking my options and am looking for individuals who want to continue the development of Shade-C. I have 2-3 guys in my head and i'll write them a pm but want to fix some critical stuff first so they have an easier starting.

I also apologize to all the people who wanted to help in the past that i didn't get back to because of lack of time. I hope you are not discouraged and will offer your help again, once there's a new "core-team" actively working on Shade-C (if there will be such a thing...).

Also, if you haven't noticed yet, Shade-C EVO is completly free now. Both for commercial and non-commercial projects.

I'll get back here at the end of 2013 and let you guys know about the current status and future of Shade-C.

See you then. (and please don't stop posting bugs, it's still important to write down all the problems and errors you encounter so they can be fixed in a future version).
Posted By: sivan

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/10/13 08:26

good to hear it is updated, and great new features are coming, sad to hear you will stop its development. hopefully there are good guys to work on it further as we cannot expect too much from the engine development side in this area... probably active 3dgs user count also dropped similarly to engine development speed.
currently I don't use shade-c evo but learnt a lot from your different shade-c packages, thanks for it!
moreover, I would be interested in what major engine bugs you realized and made your work impossible. they should be reported to be fixed. I know there is always a bug as you go further in gamestudio, but probably in other engines too.
Posted By: oliver2s

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/12/13 13:19

Wow, thank you very much for this (maybe) final update. So much things were fixed. I tried it a few hours and I think now I can really implement it in IceX3 Editor.

Great christmas gift laugh

Btw: I found some bugs (some of them I fixed already). I will do more testing and then posting a bug and fix list here.
Posted By: oliver2s

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/12/13 20:06

I wanted to add fog to the scene. But the fog color (or colors in general) are wrong in the final screen.

In the following scene I have fog color of red=128, green=0, blue=200. But in the final scene the fog colors are: red=188, green=0; blue=229.

Any ideas where I can fix this? HDR, SSAO, DOF, etc... is all deactivated.

Posted By: oliver2s

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/12/13 20:12

Another problem is DOF in combination with skycube. 1.) the sky get also blurred by DOF shader and 2.) everything that renders in forground of the sky gets a blurry outline (EDIT: only entities with transparency get a blurry outline).

Posted By: Kartoffel

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/14/13 08:40

I really like the option to swich to 16/32bit buffers but somehow everything gets brighter and looses contrast. (maybe there's a problem with the conversion between linear rgb and srgb)

edit:
also: if you don't use any normal compression in the g-buffer you can use best fit normals to improve the quality (worked well for me)
Posted By: oliver2s

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/14/13 10:33

Originally Posted By: Kartoffel
also: if you don't use any normal compression in the g-buffer you can use best fit normals to improve the quality (worked well for me)


What do you mean exactly?
Posted By: Kartoffel

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/14/13 11:03

You scale the normal to get the highest possible precision.
Posted By: oliver2s

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/18/13 09:42

I have a problem with changing settings in combination with forward rendering activated.

These are the basic settings the game starts with:

Code:
c_screen_default.settings.forward.enabled=1;
sc_screen_default.settings.refract.enabled=0;
sc_screen_default.settings.hdr.lensflare.enabled=1;
sc_screen_default.settings.hdr.brightpass=0.75;
sc_screen_default.settings.hdr.intensity=1;
sc_screen_default.settings.hdr.lensflare.brightpass=0.0;
sc_screen_default.settings.hdr.lensflare.intensity=0.5;
sc_screen_default.settings.bitdepth=32;
sc_screen_default.settings.dof.focalPos=0;
sc_screen_default.settings.dof.focalWidth=12000;
sc_screen_default.settings.ssao.radius=30;	
sc_screen_default.settings.ssao.intensity=4;
sc_screen_default.settings.ssao.selfOcclusion=0.0004; //we want a bit of self occlusion... lower values result in even more self occlusion
sc_screen_default.settings.ssao.brightOcclusion=0.25; //low value: ssao will only be visible in shadows and dark areas. high value: ssao will always be visible. Range: 0-1
sc_screen_default.settings.lights.sunPssmSplitWeight=0.7; //high res near splits, low res far splits
sc_screen_default.settings.lights.sunShadowBias=0.001; //set the shadow bias
sc_screen_default.settings.ssao.quality=SC_LOW;
sc_screen_default.settings.ssao.enabled=0;
sc_screen_default.settings.lights.sunShadowRange=5000; 
sc_screen_default.settings.lights.sunShadowResolution=512;

sc_screen_default.settings.hdr.enabled=0; 
sc_screen_default.settings.dof.enabled=0;  		
sc_screen_default.settings.lights.sunShadows=0; 		
sc_screen_default.settings.antialiasing.enabled=0;



Everything works fine:


Then I change the following settings (and call sc_setup() again):
Code:
sc_screen_default.settings.hdr.enabled=1; 
sc_screen_default.settings.dof.enabled=1;  		
sc_screen_default.settings.lights.sunShadows=1; 		
sc_screen_default.settings.antialiasing.enabled=1;



After that I get rendering errors:


If I start the game with the second set of settings there are no rendering errors, just after switching to them after other settings were set before.
Posted By: oliver2s

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/18/13 10:27

Another issue: if I call sc_destroy() and sc_setup() many times (because of level changes for example), there is a video memory leak. And the more I call sc_destry() and sc_setup() the more the framerate drops.
Posted By: oliver2s

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/26/13 14:46

Fixed all of the bugs I've posted above. I'v e-mailed BoH_Havoc and asked him, if I can publish a new Shade-C EVO version with the fixes and features I've made.
Posted By: sivan

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/26/13 18:23

great news. have you made some speed tests we talked about with large outdoor environments?
Posted By: Quad

Re: Shade-C EVO: Deferred Transparency (1-Layer) - 12/26/13 18:41

@oliver, you can fork the main github repo and send pull requests.
Posted By: oliver2s

Shade-C EVO: Fog support + Bug Fixes - 12/26/13 20:28

Thank you for the hint Quad.

Here's the new version v1.1:

https://github.com/oliver2s/ShadeC-EVO

The setup call works a bit different now then before. You have to call sc_setup(mode) within the "mode" parameter. Parameter can be SHADEC_LOW, SHADEC_MEDIUM, SHADEC_HIGH, SHADEC_ULTRA. These predefined modes can be edited in sc_wrapper.c in function sc_get_settings(). As before you have also set sky with sc_sky and destroy Shade-C before level loading with sc_destroy(sc_screen_default).

I've updated the example levels, so you can clearly see how the setup call has to be made.

Code:
changes v1.1
- added simple global vertex fog (uses standard 3DGS fog variables
view.fog_start, view.fog_end, d3d_fogcolor1, etc...)
- rewrote the wrapper functions. After level loading call sc_create(mode) (mode can be SHADEC_LOW, SHADEC_MEDIUM, SHADEC_HIGH, SHADEC_ULTRA), these predefined modes can be edited in sc_wrapper.c in function sc_get_settings().
- fixed memory leaks
- added alpha clipping to PSSM sun shadow
- updated the example levels



Posted By: oliver2s

Re: Shade-C EVO: Fog support + Bug Fixes - 12/26/13 20:43

Originally Posted By: sivan
great news. have you made some speed tests we talked about with large outdoor environments?


Not yet.
Posted By: BoH_Havoc

Re: Shade-C EVO: Fog support + Bug Fixes - 12/28/13 15:07

Thanks oliver! laugh

I didn't get an e-mail from you, but got a mail from github with a pull request. Either way, i got the changes.

I already commented on your commit on github, so i'll just copy/paste it here.

Quote:

Awesome!
Will check it out in the next few days.

I will most likely kick out the vertex fog and implement it per pixel in the final deferred rendering stage which should be faster and will also look more accurate.

I'm not really convinced about how the mode settings currently work. I think this makes things a bit harder on the user when updating shade-c as the settings will be overwritten. Maybe we can put it in an external file, check if it's there, and then use the values. Otherwise default values will be used. What do you think?

Thanks again! (Especially for fixing the memory leaks!)



[edit]
Quote:

I really like the option to swich to 16/32bit buffers but somehow everything gets brighter and looses contrast. (maybe there's a problem with the conversion between linear rgb and srgb)

edit:
also: if you don't use any normal compression in the g-buffer you can use best fit normals to improve the quality (worked well for me)


I'll have a look at it. I think it has something to do with how the lighting is stored (it's some sort of inverted alpha blending which might not work as espected with floating point values).
I'll also remove the bitdepth value and add 3 bitdepth values instead. One for g-buffer, one for lighting and one for multi purpose rendertargets.
I tried using best fit normals in the past but didn't go for it as i wanted depth and normals in one texture for speed reasons (if you need normals, you also need depth 99% of the time...saved me one tex lookup and some bandwith). Still not sure if this is a good idea though...best fit normals really DO look good and are well worth the extra bandwith and texlookup. Also, after implementing PBR and static shadowmaps, there will still be 2-3 free channels in the g-buffer. More than enough to implement best fit normals and maybe even add some per object motion blur laugh
Posted By: rojart

Re: Shade-C EVO: Fog support + Bug Fixes - 12/28/13 15:10

Thank you oliver2s!

I'll check it now, last time i had some problems with normal maps on level blocks and it worked only if i added a default light.

EVO light:



With EVO and default light:

Posted By: BoH_Havoc

Re: Shade-C EVO: Fog support + Bug Fixes - 01/10/14 18:52

Took a bit longer, but here's the update with most of oliver2s's stuff and some changes by me.

Quote:

- Added linear fog
- Added optional height based fog
- Added optional, animated fog noise
- Added fog example 07.c
- Tweaked DoF Shader to prevent leaking
- Nicer DoF effect due to a fixed blurshader
- fixed memory leaks
- added full support for custom shadowmap shaders for the sun (was missing in the past. example 05.c now also works with sun shadows)
- removed bitdepth var.
- added bitdepthGBuffer, bitdepthLBuffer and bitdepthGRTs


I think this is everything, except some small fixes here an there.

Screenshot of the fog shader with height based fog and animated noise turned on. Looks pretty cool in motion!




There's still some stuff missing from oliver2s github fork. The remaining things will be added in the next days. laugh
Posted By: oliver2s

Re: Shade-C EVO: Fog support + Bug Fixes - 01/10/14 19:02

Thank you. The new fog features sound promising, I will give it a try next week laugh
Posted By: sivan

Re: Shade-C EVO: Fog support + Bug Fixes - 01/10/14 22:02

yeah, another great thing to dig into! laugh
Posted By: oliver2s

Re: Shade-C EVO: Fog support + Bug Fixes - 01/15/14 12:43

Small bug I forgot while fixing memory leak: the "UNTOUCHABLE" flag of the main view (usually "camera") is not reset when Shade-C is destroyed.
Posted By: oliver2s

Re: Shade-C EVO: Fog support + Bug Fixes - 02/06/14 21:13

Updated the GitHub Code and added the function "sc_light_remove(ENTITY* ent)" to it. With this function shade-c light can be remove and all memory will be freed and released.
Posted By: rojart

Re: Shade-C EVO: Fog support + Bug Fixes - 02/15/14 12:01

Thanks oliver2s & BoH_Havoc for the updates!

Maybe a bug or maybe i've overlooked something, but if i try to move the camera a bit from center i got artefacts on skybox, like picture below.
I tried to increase the camera.clip_far = 50000 same result.

I noticed also, if i activate a Statistics Panel [F11] the skybox working well, any idea whats going wrong?

Posted By: rayp

Re: Shade-C EVO: Fog support + Bug Fixes - 02/15/14 12:53

I love shadec...i really thank you so much for that "new dimension".

I faced a small prob, maybe iam doing something wrong. If i place sprites with the material from the example via ent_decal fex, i get strange looking effects. There's always only one sprite visible. If u turn the cam a bit, randomly another decal becomes visible. Seams that only one decalsprite is translucent at same time. Means u can see the wall behind, but not the decals placed below. Looks like some kind of "z - sorting(alpha) prob". Hope i could descripe it well enough. Guess a screenshot wont help much in this case.

So...
If u place two translucent sprites via ent_decal ( first one, then the other on top / over the 1st at same position ) on a shaded model, u should see what i mean. To avoid that effect ( for now only of course ), i removed #define TRANSLUCENT from the .fx file. Now all decals are displayed correct, except of the now missing translucent - flag.

edit:
I faced a problem with ZNEAR. Activated ZNEAR in my fps weapon. Then lights are randomly disapearing. Is there maybe an own (shadec) znear flag ? Found this one "#define SC_CUSTOM_ZBUFFER" but dont know if thats what iam looking for.

Till then
Thanks for any tip's
MfG
Posted By: oliver2s

Re: Shade-C EVO: Fog support + Bug Fixes - 02/16/14 17:00

@Robert: did you set the sky cube with the sc_sky() instruction (see example levels)?
Posted By: rojart

Re: Shade-C EVO: Fog support + Bug Fixes - 02/16/14 19:41

Yes, use the 07.c sample and change camera parameters to:
you = ent_create(NULL, vector(-2316,1360,1291), v_camera);
you.pan = 149;
you.tilt = -3;

Should be exactly the same result like picture above.
Posted By: oliver2s

Re: Shade-C EVO: Fog support + Bug Fixes - 02/17/14 09:09

Yes, I've got the same result. But I don't know what could cause this problem. Maybe BoH Havoc see this bug report.
Posted By: rayp

Re: Shade-C EVO: Fog support + Bug Fixes - 02/20/14 13:29

Would somebody be so nice to give me a tip how i can use ZNEAR ( now for a fps weapon ) with shade-c lights ? Iam too stupid to get this work. Ive set two lights. If the weapon has ZNEAR, one of the lights is disappearing ( belongs to direction camera looking into ). Sometimes both are visible, sometimes only one. Iam happy for any tips / hints.

Edit: Now it seams to work ( at least i think so grin ). seams the direction of a Spotlight caused this.
Posted By: rojart

Re: Shade-C EVO: Fog support + Bug Fixes - 02/24/14 18:44

Originally Posted By: oliver2s
Yes, I've got the same result. But I don't know what could cause this problem. Maybe BoH Havoc see this bug report.

Thanks for testing, seems to be the default sun light wrong in EVO, if setting the sun_color to NULL the skybox works.
Posted By: rayp

Re: Shade-C EVO: Fog support + Bug Fixes - 02/24/14 20:35

Anybody faced the same problem that ZNEAR isnt working correct with ShadeC EVO dynamic lights ? Did i miss something ?

Another question: Is there any skill value to control ambience of model ? Like my.ambient = 30; ?

Thanks
Greets
Posted By: rojart

Re: Shade-C EVO: Fog support + Bug Fixes - 04/17/14 23:52

ZNEAR tested and works well by me, what exactly happens with your code?
Posted By: rojart

Re: Shade-C EVO: Fog support + Bug Fixes - 04/19/14 22:44

Originally Posted By: oliver2s
Yes, I've got the same result. But I don't know what could cause this problem. Maybe BoH Havoc see this bug report.

Ok i found the problem in sc_gBuffer_sky.fx if we change to alphablendenable = false; should work.
Posted By: rayp

Re: Shade-C EVO: Fog support + Bug Fixes - 04/19/14 23:20

Quote:
ZNEAR tested and works well by me, what exactly happens with your code?
Hello,
in some situations ( near ) lights disappearing ( when looking in some directions ). Only if my used weapon action is flagged with ZNEAR. Besides that, ( 4ex ) my fire - particles are rendered / visible through walls ( =blocks with shadec material ) if ZNEAR is set. No ZNEAR, everythings fine. Its a fps project, weapon is placed close to the camera vectors and ive set camera.clip_near to 1 btw. The light - znear - "Bug" seams to be a "random".

For some particle effects ive set those var's to 1:
Code:
sc_screen_default.settings.forward.enabled = 1;
sc_screen_default.settings.refract.enabled = 1;


Maybe i made those probs myself, if nobody else having probs with ZNEAR, guess so.

Greets
Posted By: DLively

Re: Shade-C EVO: Fog support + Bug Fixes - 04/20/14 02:10

I don't use ZNEAR at all. At all. So It must be something irrelevant to ZNEAR? Or maybe its just us rayp xD
Posted By: rojart

Re: Shade-C EVO: Fog support + Bug Fixes - 04/20/14 13:00

Originally Posted By: rayp
Quote:
ZNEAR tested and works well by me, what exactly happens with your code?
Hello,
in some situations ( near ) lights disappearing ( when looking in some directions ). Only if my used weapon action is flagged with ZNEAR. Besides that, ( 4ex ) my fire - particles are rendered / visible through walls ( =blocks with shadec material ) if ZNEAR is set. No ZNEAR, everythings fine. Its a fps project, weapon is placed close to the camera vectors and ive set camera.clip_near to 1 btw. The light - znear - "Bug" seams to be a "random".

For some particle effects ive set those var's to 1:
Code:
sc_screen_default.settings.forward.enabled = 1;
sc_screen_default.settings.refract.enabled = 1;


Maybe i made those probs myself, if nobody else having probs with ZNEAR, guess so.

Greets


Tried my solution with skybox above?
Any screenshot would be also great.
Posted By: Reconnoiter

Re: Shade-C EVO: Fog support + Bug Fixes - 05/31/14 16:56

Even though I followed all the step in 'Getting Started' and 'Modules', I can't seem to get this work.

Error in sc_shadows.c; D3DXMatrixOrthoLH underclared indentifier.

Even if I do #include <d3d9.h>, I get an error. Error in windows.h line 6519; RECT rcPaint.

Anyone know what I am doing wrong? tnx

ps: version shade-c_v0.91_BETA_S1
Posted By: sivan

Re: Shade-C EVO: Fog support + Bug Fixes - 06/01/14 20:43

I don't know what could be the problem, in theory only d3d9.h needed as you wrote.
but dynamic shadowmapping in 0.91b is a bit buggy, the variance and squared variance is wrongly calculated, thus you will never get really smoothed shadows, despite the test scene looks okay.
I corrected it and as I remember shared it in the forum earlier, but was not satisfied with performance and quality, so finally I took it out of shade-c and transformed into exponential shadowmapping. if you take its source from latest MapBuilder I think you can put it back into shade-c with some work...
probably you do better if switch to Shade-C EVO.
Posted By: Reconnoiter

Re: Shade-C EVO: Fog support + Bug Fixes - 06/02/14 12:03

Thank you for commenting. I now use Shade-C EVO but have the same problem. Also the documentation for Shade-C EVO seems to be gone compared to the Shade-C beta (the only readme I can find has ~6 lines of text), so I don't know if I am including the right stuff.

Code:
///////////////////////////////
#define PRAGMA_PATH "shadec"

#include <d3d9.h>
#include <acknex.h>
#include <mtlFX.c>
#include <mtlView.c>
#include "sc_core.c";
#include <default.c>

...
...

function main()
{
...
sc_setup(); //setup Shade-C
...
}

Posted By: DLively

Re: Shade-C EVO: Fog support + Bug Fixes - 06/15/14 14:03

Code:
#include <litec.h>
#include <acknex.h>
#include <default.c>

#define PRAGMA_PATH "shadec"

//include Shade-C
#include "shade-c.h"
#include "common.h"

.....

function main()
{
//wait until after level_load();
vec_set(sky_color, vector(0,0,0));
	vec_set(ambient_color, vector(0,0,0));
	
	camera.size_x = screen_size.x;
	camera.size_y = screen_size.y;
	sc_screen_default = sc_screen_create(camera);
	
	sc_screen_default.settings.forward.enabled = 1; //enable if you need particles or custom materials which can't be rendered in the deferred pipeline
	sc_screen_default.settings.refract.enabled = 1; //enable for refractive effects such as heat haze and glass
	sc_screen_default.settings.hdr.enabled = 1; //enable Bloom/HDR
	sc_screen_default.settings.hdr.lensflare.enabled = 0; //enable for a nice lensflare effect in combination with HDR/Bloom
	sc_screen_default.settings.dof.enabled = 0; //enable Depth of Field Effect
	sc_screen_default.settings.ssao.quality = SC_MEDIUM; //set ssao quality. SC_LOW, SC_MEDIUM, SC_HIGH, SC_ULTRA
	sc_screen_default.settings.ssao.enabled = 1; //enable to activate SSAO
	sc_screen_default.settings.lights.sunShadows = 0; //enable shadows for the sun
	sc_screen_default.settings.lights.sunShadowResolution = 512; //reduce shadow resolution as we are manually setting the shadow range to 5000 and can therefor get away with a small shadowmap
	sc_screen_default.settings.lights.sunPssmSplitWeight = 0.7; //high res near splits, low res far splits
	sc_screen_default.settings.lights.sunShadowRange = 5000; //manually set the shadow range...we don't need realtime shadows in the far distant! If set to 0 (default) shadow range will be set to camera.clip_far
	sc_screen_default.settings.lights.sunShadowBias = 0.001; //set the shadow bias
	sc_screen_default.settings.antialiasing.enabled = 1; //enable antialiasing
	
	//initialize shade-c, use default screen object
	sc_setup(sc_screen_default);
	
	//tweak effect parameters anytime you want
	// -> more info in sc_core.h, in struct SC_SETTINGS
	sc_screen_default.settings.hdr.brightpass = 0.85;
	sc_screen_default.settings.hdr.intensity = 2;
	sc_screen_default.settings.hdr.lensflare.brightpass = 0.0;
	sc_screen_default.settings.hdr.lensflare.intensity = 0.25;
	sc_screen_default.settings.dof.focalPos = 300;
	sc_screen_default.settings.dof.focalWidth = 600;
	sc_screen_default.settings.ssao.radius = 30;	
	sc_screen_default.settings.ssao.intensity = 4;
	sc_screen_default.settings.ssao.selfOcclusion = 0.0004; //we want a bit of self occlusion... lower values result in even more self occlusion
	sc_screen_default.settings.ssao.brightOcclusion = 0.25; //low value: ssao will only be visible in shadows and dark areas. high value: ssao will always be visible. Range: 0-1

}

//this IS a local entity. Place it in an action.
ENTITY* light_child = sc_light_create(vector(my.x, my.y, my.z), my.skill4, vector(my.skill1,my.skill2,my.skill3), SC_LIGHT_SPOT | SC_LIGHT_SPECULAR | SC_LIGHT_SHADOW , vector(my.pan, my.tilt-90, my.roll), my.skill5);



I think this is all you need for lighting if you haven't already looking in the map builder laugh
Posted By: FEL

Re: Shade-C EVO: Fog support + Bug Fixes - 08/02/14 15:32

Hello guyz,
Im getting trouble with a file called "sc_deferredLighting_LUT.dds"
It causes an rror called "error: 88760b59".

I cant fix it like in the description:


- If you got something like this "error: 88760b59" after compiling, just copy the sc_deferredLighting_LUT.dds file to the work folder. -


Workfolder?!?!?! Ive got an entire Datasystem for my project... there about 20 folders... where dafaq should the file go Oo how can i know?!

laugh
Posted By: DLively

Re: Shade-C EVO: Fog support + Bug Fixes - 08/02/14 17:02

Workfolder is the primary (root) folder which all your project is contained
Posted By: FEL

Re: Shade-C EVO: Fog support + Bug Fixes - 08/02/14 17:10

My Project ist located there... as usaully. So the file is in Spot. But it does not work properly.
Posted By: Kartoffel

Re: Shade-C EVO: Fog support + Bug Fixes - 08/03/14 05:31

Err, the work folder is the folder where your main script is located?
Posted By: FEL

Re: Shade-C EVO: Fog support + Bug Fixes - 08/03/14 11:30

its all in the 3dgs folder, locateted in Work.
Oo i mean why not?
Posted By: DLively

Re: Shade-C EVO: Fog support + Bug Fixes - 08/03/14 14:18

Quote:
Err, the work folder is the folder where your main script is located?

Thats a better way to put it - I usually leave my main script in the root folder.

Quote:

its all in the 3dgs folder, locateted in Work.
Oo i mean why not?


Dont put it there, if you upgrade your GS version, you may lose your projects. put your projects in (ie) Documents / 3DGS / 'Project title folder' or something
© 2024 lite-C Forums