Quote:

It seems that you are storing data in these skills. Though, saying the user that these skills are unavoidable used by shade-C

makes a bitter taste on the tongue :-) I was in same situation some weeks ago: for a customer I made a plugin. At first there

were only 6 skills I needed, after some development iterations I used over 30 skills to save and log running data which very

necessary and not able to be reduced anymore. So I created a struct which holds the data and write the adress of the struct

into only one skill. The co-routine which works on that entity with this data than restores by casting each frame a pointer to

that datastructure. To remove the entity I wrote a special function which checks if the linking skill is != 0. If yes, the

entity is using that plugin and the linked datastructure, so it removes it first and after that ent_remove is called. Easy,

isnt it?




I only understood half of it, but i will have a look at it again when i'm less dizzy Reducing the needed skills to 1 is a must!

Quote:


Quote:

I'll have a look at it, but it shouldn't be to much work. But not today, i'm too tired.



Thanks!




Alright here goes:
For HDR you have to create 6 views (or less if you only blur it once or twice).
1st view => s_hdrDownsample.fx : applies a 4x downsample
2nd view => s_hdrHighpass.fx : does a highpass for getting the bright parts of the scene
3rd view => s_hdrBlur.fx : blurs the highpass
4th & 5th view => s_hdrHBlur.fx & s_hdrVBlur.fx : blurs it even more
6th view => s_hdrTonemap.fx : upsamples the bloom (we did that in the last 5 views), combines it with the original scene and does tonemapping

the size of view 1-5 has to be a power of 4 (256x256, 512x512, depends on your game's resolution). view1-5.bmap also needs to be a power of 4 (same as size)

s_hdrHighpass.fx vecskill1.x => sets the bloomstrength (range: 0-1)
s_hdrBlur.fx & s_hdrHBlur.fx & s_hdrVBlur.fx vecskill1.x => sets the blurstrength
s_hdrTonemap.fx vec.skill1.xw => x: applies gamma correction w: size of view 1-5

camera.stage = view1;
.
.
view5.stage = view6;

that should be it (for HDR)


DoF:
4 views for dof + 1 view rendering the depthmap (s_rDepth.fx)
1st view => s_dofDownsample.fx : 4x downsample, you know the drill
2nd & 3rd view => s_dofHBlur.fx & s_dofVBlur.fx : blur it and apply anti edge bleeding
4th => s_dof.fx upample the blurred view, combine it with the original scene using the depthmap

again, view 1-3 have to be a power of 4 and 256˛ oder 512˛ in size/bmap.

s_dofHBlur.fx & s_dofVBlur.fx vecSkill1.x => blurstrength
s_dof.fx vecSkill1.w => size of view1-3 |
texture TargetMap; //Blurred Scene
texture mtlSkin1; // original Scene
texture mtlSkin2; // Depthmap

s_rDepth vecSkill1.xyz => x = focal plane pos | y = focal Plane depth / area of sharpness | z = if you set this to 1, the object will be rendered white (=sharp) all the time.
The DoF-Depthmap gets rendered to .a ! s_rDepth also outputs a "normal" depthmap to rgb. you can set its values with vecSkill5.xy (x maxDepth | y focal plane)

camera.stage = view1;
.
.
view3.stage = view4;

and thats it for dof.
I hope i didn't forget something.



Quote:

edit: i noticed that you kinda did it with the toon shader, but maybe witout bloom it would look better




Yeah, i have HDR and DoF activated on this shot. If you deactivate them there won't be any bloom But thanks for pointing it out, i will write a note after "Cartoonshader" on the site and also upload a new picture.

Quote:

I need a pro... :'(




I don't even have A7 Pro myself. All you need is A7 Com



@William:
I have no idea whats happening here. Could you try setting s_dofParams to something like this:
var s_dofParams[3] = {900, 80, 2.5};

and then calling s_dofDynFocus(30,10000,1); after s_initShaders()?
If everything works out, every object you look at should become sharp.

To output the Depthmap you can use this:
open up s_showRT.fx, find this line
float4 Color = tex2D(smpSource,(Tex.xy));
and insert this after it
Color.rgb = Color.a;

Now call this after s_initShaders();
s_ppe(1,"s_showRT.fx",nullvector);
s_ppeTex(1,1,s_bmap_depth);

This should output the DoF-Map.
Also please make sure you have set s_bDoF = 1 before callign s_initShaders(). If you don't want to set s_bDoF, please call s_initDepth() so the depthmap gets rendered.



cheers and thanks for all the feedback. I see i have lots to improve


Shade-C EVO Lite-C Shader Framework