HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: 1 [2]

Author Topic: [Resolved] Shader Question  (Read 6231 times)

Lunchbox

  • World Owners
  • ****
  • Posts: 136
    • View Profile
    • BrandNGames
Re: Shader Question
« Reply #15 on: Aug 18, 12, 01:13:44 AM »

Well if I understand the situation currently we cant really add any post fx type of shaders. Not til 1.8 maybe someone from HE can confirm or correct me on that. I plan to use some more along the lines of a full screen edge detection instead of doing a 2 pass on each model.

I tried using both scene_toonEdges, scene_lineDraw and even a few sobel shaders and was running around with my head cut off hehe. Never did get them to work. I may try again in a day or so though. The 2 pass almost works but the whole alpha issue pretty much killed it for me. Dont feel like remodeling all my fences and stuff.

Figured I would paste this before I crash. For the bone animation this might point you in the right direction. With my two pass it does the in position world matrix thing just use the if define bone animation inside the vertex shader assuming your using a simlar 2 pass as me. I havent tested this but I may tomorrow. Ill let you know whether this works or leads me in the right direction or not.

     #if defined(BONE_ANIMATION)
        float4 worldpos = DeformPositionByBones(BoneMatrixPalette,In.BlendData,In.Position);
      #else
        float4 worldpos = mul(In.Position, WorldMatrix);
/     #endif
« Last Edit: Aug 18, 12, 01:39:01 AM by Lunchbox »
Logged

angelsin

  • World Owners
  • ****
  • Posts: 33
    • View Profile
Re: Shader Question
« Reply #16 on: Aug 18, 12, 02:32:17 AM »

didnt draw any edges for me. we started from the same script btw. not sure how you modified yours though
Logged

HE-HERB

  • HeroEngine
  • *****
  • Posts: 530
    • View Profile
    • HeroEngine
Re: Shader Question
« Reply #17 on: Aug 18, 12, 07:37:06 AM »

No offense, but you're making this way too complicated.

Copy the existing vertex and pixel shaders.  Rename them, call them in an initial pass before the existing ones.


You only need to change 1 line in the vertex shader: the vertex output position - you probably want to extrude this along the normal..

You only need to change 1 line in the pixel shader: the output color - change it to black.

That's it



We don't provide a cel shader for one really really simple reason: we don't have a default world of assets where it works on everything.

As I said before, cel shaded assets have a number of requirements with regards to hulls, normals, etc.

The assets for the social world, for example, were not built with the intent of those being used directly as cel shaded assets.

If you've created assets that work for cel shading, that's awesome.  However, we haven't released a scene that works out of the box for cel shading.



You can already set custom shaders in Topaz through the HeroMaterial.


A more flexible post-processing stack will be addressed in the short term after the initial Sapphire release.


Cheers
Logged
herb marselas
graphics guy

Lunchbox

  • World Owners
  • ****
  • Posts: 136
    • View Profile
    • BrandNGames
Re: Shader Question
« Reply #18 on: Aug 19, 12, 05:55:49 PM »

Well I did get a sobel filter working with the pixel shader but running into issues that I need to work out hehe. It acts like its using shader 1.1 and the lighting is all messed up.

I've given up on the sobel filter for now. Lighting issues aside it just doesn't give the right look which can easily be done to the textures themselves saving on shader calculations. It barely did edge detection at all and more or less brought out the darker lines already in the scene hehe so it didnt have the right effect.  I think part of the reason was due to it being done to that regular shader instead of full screen effect like its originally intended to do. Anyways Ill give this another go once we can add our own full screen effects. Probably best to use the two pass method we talked about earlier for outlining.
« Last Edit: Aug 20, 12, 03:47:39 PM by Lunchbox »
Logged

angelsin

  • World Owners
  • ****
  • Posts: 33
    • View Profile
Re: Shader Question
« Reply #19 on: Aug 21, 12, 06:37:05 PM »

sounds good. I have been just working on getting some new assets that are designed  for cel shading, I got the two pass working fairly well, still cant get the player character to be cel shaded but I think that when I make new pc meshes I'll just add a cel shader to them before I export them from max
I too will revisit the issue when we have access to post processing shaders
Logged
Pages: 1 [2]