YOUR ACCOUNT

Login or Register to post new topics or replies
Aram Azhari
Aram

Posts: 17
Hi.

I'm trying to write a shader in a game engine to support the AO maps generated by filter forge.

This is actually a technical question from the FF developers. What is the relation that I should use to apply the AO on the texture?

Currently I'm multiplying the texture with the AO, but it gives me a very dark texture which does not resemble the preview in the FF software.

What is the best way to combine them?

Thank you.
___________
Aram Azhari
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
You're doing it perfectly fine by multiplying it. What you probably will need to do is to edit the AO so it's not so dark, you can use Photoshop and just adjust some levels till you get something satisfying. You may also decrease the mix (opacity) between the AO and the texture.

AO maps in filterforge can be manipulated by tweaking the AO settings. (see some picts here http://www.filterforge.com/features/v...sion.html)
  Details E-Mail
Aram Azhari
Aram

Posts: 17
Thank you for the explanation.

The link however, doesn't work.

It seems it looks brighter when I do it in photoshop (multiply overlay). But in the shader (CGSL) it makes it so dark that the colors almost look black and white.
___________
Aram Azhari
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
Sorry D: http://www.filterforge.com/features/v...usion.html

Hmmm... That sounds like a problem with the shader setup. Would need to see the settings for further diagnosis....

I mean, the other thing you can do is just export it out with the AO already on the diffuse layer instead of mixing it in the shader as a pass if that works for you....
  Details E-Mail
Aram Azhari
Aram

Posts: 17
Actually that is not a bad idea.
btw, here is the Cg code:

Quote
CGPROGRAM
#pragma surface surf BlinnPhong

sampler2D _MainTex;
sampler2D _BumpMap;
sampler2D _GlossTex;
sampler2D _AOTex;

fixed4 _Color;
half _Shininess;

struct Input {
float2 uv_MainTex;
float2 uv_BumpMap;
float2 uv_GlossTex;
float2 uv__AOTex;
};

void surf (Input IN, inout SurfaceOutput o) {
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
fixed4 gloss = tex2D(_GlossTex, IN.uv_GlossTex);
fixed4 aocclusion = tex2D(_AOTex, IN.uv__AOTex);

o.Albedo = tex.rgb * aocclusion.a * _Color.rgb;
o.Gloss = gloss.a;

o.Alpha = tex.a * _Color.a;
o.Specular = _Shininess;
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
}
ENDCG
___________
Aram Azhari
  Details E-Mail
Aram Azhari
Aram

Posts: 17
And how can I export the AO on the diffuse?

If I choose diffuse from the render maps menu it won't apply the AO.
And If I choose the 'Off' thingy, then it will also apply the normals and the bump and all other maps which I need to apply them later for real-time rendering interactions.
___________
Aram Azhari
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
.. strange... in my head it works. Did .a indicate alpha or a black and white map input? (ancient memories arise!)
  Details E-Mail
Aram Azhari
Aram

Posts: 17
Yes .a is alpha, btuactually , I have created the alpha from the greyscale of the map.

So I'm simply using the alpha channel to pass the greyscale color (black and white map).
___________
Aram Azhari
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
spam
  Details E-Mail
Aram Azhari
Aram

Posts: 17
What do you mean?
Which tutorial?
___________
Aram Azhari
  Details E-Mail
Aram Azhari
Aram

Posts: 17
You're right uberzev, it is totally spam.
Is there an spam report?
___________
Aram Azhari
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,712 Registered Users
+19 new in 30 days!

153,533 Posts
+31 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

29 unregistered users.