|
|
|
Return to Code Snippets
by Manou » Wed Aug 31, 2011 8:16 am
Thanks!
About the final scene, would you prefer a pawn-like scene (with the ground in circle, low scale model renderer with huge dof) :
(no warhammer panda!)
or more realistic one, no finite borders in the scene :

-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by Manou » Wed Aug 31, 2011 6:10 pm
Anim & grass updates.
I solved the fur disappearing bug with
- Code: Select all
fur.setTransparency(TransparencyAttrib.MDual, 1)
there is quality loss but no more bugs!
VIDEO:
http://youtu.be/63LgZc8HdjI
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by redpanda » Thu Sep 01, 2011 4:18 am
Nice. When did you add smooth shadows and bloom?
-
redpanda
-
- Posts: 380
- Joined: Wed Aug 03, 2011 6:34 am
by Manou » Thu Sep 01, 2011 9:09 am
Thanks.
Soft shadows comes from the PCF shadows example someone posted in the forum. But atm they are wrong because the amount of blur is not function of distance, it simply samples the depth map a few times with a varying offset and calculates the average resulting shadow.
Edit: bloom comes from my still not clean deferred shading scene. I found out dof and bloom are not friends with shell fur 
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by Bradamante » Thu Sep 01, 2011 4:46 pm
I'd like to try this to see if it works on under Mac OS X. Your first post does not contain the code you got right now, right?
iMac (2009), Mac OS X.8.1 - MacBookPro (2007), Mac OS X.8.2
@ YouTube
-

Bradamante
-
- Posts: 303
- Joined: Tue Nov 25, 2008 10:58 am
- Location: Leipzig, Germany
by Manou » Thu Sep 01, 2011 6:09 pm
Yep. I can post you the current files but I prevent you it is highly unoptimized 
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by Manou » Fri Sep 02, 2011 8:22 am
Here you go :
http://www.sendspace.com/file/xrr2wo
This is current dev version, so the code is horrible, variables names are not OK and it is not optimized in any way
The panda is not finished as well, the current pose is wrong.
Execute fur/fur.py to launch the program.
You need panda last version (shaders inputs).
You can change these class constants to get more fps
- Code: Select all
NBRE_FUR = 10 NBRE_GRASS = 10
1 : panda fur gravity
2 : panda fur length
3 : panda fur alpha (set it close to the left)
4 : panda fur lighting plus
5 : don't touch
6 : shadows bias
7 : activate fur lighting plus
8 : camera aperture size
9 : camera focus
10 : camera light exposure
11 : bloom factor
12 : brightness reduction
13 : grass gravity
14 : grass length
15 : grass alpha
16 : grass light plus
17 : dont touch
18 : activate grass light plus
Press 'V' to make gui disappear (can't go back)
!BEWARE!
The scene is shader and fillrate intensive, watch your graphic card temperature !
!BEWARE!
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by ThomasEgi » Sat Sep 03, 2011 3:27 am
i feared this day would come. but today is the first day i whish my gpu would be more powerful. all it does is, counting up some numbers, than flat out crashes with tons of shader errors.
in case this eye-feast is supposed to run on a mobile gf8600gt,lemme know and i will provide the error logs.
besides. looks fantastic on the screens and vid
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by coppertop » Sat Sep 03, 2011 7:25 am
Is there a reason this is Windows only?
-

coppertop
-
- Posts: 526
- Joined: Sat Apr 18, 2009 5:48 am
by Manou » Sat Sep 03, 2011 9:27 am
Hey,
coppertop, I coded it under ubuntu, maybe you need panda last buildbot version to execute it.
ThomasEgi, besides fxaa shader, it should work with "basic shader only". I have this error sometimes with the main light shader when I compile it:
- Code: Select all
fatal error C9999: negative loop iteration count
yeah it should work on a 8600 ! post me the logs.
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by coppertop » Sat Sep 03, 2011 9:55 am
Ok, seems like I clicked the wrong "Click here to start download" and it wanted to download some Setup.exe file. Now i see it was some moronic application advertised... That's why I hate, seriously hate, all those filesharing things with banners on top...
Anyway, got the right file and will be testing in a sec
Now more to the point:
- Code: Select all
Traceback (most recent call last): File "fur.py", line 1043, in <module> app = MyApp() File "fur.py", line 563, in __init__ quad.setShaderInput("hdr_params", Vec3(self.exposure,self.bloomfactor,self.brightmax)) TypeError: Arguments must match one of: setShaderInput(non-const NodePath this, const ShaderInput inp) setShaderInput(non-const NodePath this, non-const InternalName id) setShaderInput(non-const NodePath this, string id) setShaderInput(non-const NodePath this, non-const InternalName id, const Vec4 v) setShaderInput(non-const NodePath this, non-const InternalName id, const NodePath np) setShaderInput(non-const NodePath this, non-const InternalName id, non-const Texture tex) setShaderInput(non-const NodePath this, string id, const Vec4 v) setShaderInput(non-const NodePath this, string id, const NodePath np) setShaderInput(non-const NodePath this, string id, non-const Texture tex) setShaderInput(non-const NodePath this, non-const InternalName id, float n1) setShaderInput(non-const NodePath this, string id, float n1) setShaderInput(non-const NodePath this, non-const InternalName id, const Vec4 v, int priority) setShaderInput(non-const NodePath this, non-const InternalName id, const NodePath np, int priority) setShaderInput(non-const NodePath this, non-const InternalName id, non-const Texture tex, int priority) setShaderInput(non-const NodePath this, string id, const Vec4 v, int priority) setShaderInput(non-const NodePath this, string id, const NodePath np, int priority) setShaderInput(non-const NodePath this, string id, non-const Texture tex, int priority) setShaderInput(non-const NodePath this, non-const InternalName id, float n1, float n2) setShaderInput(non-const NodePath this, string id, float n1, float n2) setShaderInput(non-const NodePath this, non-const InternalName id, float n1, float n2, float n3) setShaderInput(non-const NodePath this, string id, float n1, float n2, float n3) setShaderInput(non-const NodePath this, non-const InternalName id, float n1, float n2, float n3, float n4) setShaderInput(non-const NodePath this, string id, float n1, float n2, float n3, float n4) setShaderInput(non-const NodePath this, non-const InternalName id, float n1, float n2, float n3, float n4, int priority) setShaderInput(non-const NodePath this, string id, float n1, float n2, float n3, float n4, int priority)
Then again, this error might be because I'm on Panda 1.7.2.
-

coppertop
-
- Posts: 526
- Joined: Sat Apr 18, 2009 5:48 am
by ThomasEgi » Sat Sep 03, 2011 12:04 pm
just updated my panda to the latest cvs and disabled compiz. it now.. well i wont call it running. but i do get a nice dia-show with a panda
looks great.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by Manou » Thu Sep 15, 2011 8:08 am
Some update :
- shell fur now works with geometry instancing,
- variable hair length / texture,
- wind effect,
- variable directions on hair, they will be more wavy than here but I have problems with my **** UV's.
VIDEO:
http://youtu.be/wqe1APKfuFQ
PS: the nose is a bit too big & large now 
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by ThomasEgi » Thu Sep 15, 2011 8:34 am
awww it's so cute with the nose sniffeling around♥
besides. the fur looks awesome!
but still.. i wanna cuddle it!
great work , didn't expect anything else from you actually.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by coppertop » Thu Sep 15, 2011 9:22 am
Wallpaper please ;D
Manou, you rock, you are awesome and... I'm amazed by the fact that you actually care about the looks of the panda model. Most people would just write that awesome stuff and it would still be admirable enough, but you also care about surrounding details and presentation. I take my hat off to you and I hope you'll stay with us for a long time because we need people like you.
Keep it up and I wish that one day your work will land in Panda itself.
-

coppertop
-
- Posts: 526
- Joined: Sat Apr 18, 2009 5:48 am
by Manou » Fri Sep 16, 2011 4:49 am
Thanks man!
Wallpaper will come later ;D it's not ready yet.
I'm a bit maniac with the panda anatomy and I'm refining it as I see new errors but it's a slow process. Maybe one day he will have real eyes
What I want in the final scene now :
- bamboos trunks + bamboos leaves shadows,
- water,
- vol. lighting,
- vol. dust / haze,
- fake insects,
The bamboos and projected shadows are somewhat ready, I tried to project 3 planes on the ground but I didn't get the look I wanted, only the crisp shadows give correct results (aka the blur projected plane doesn't give blurred shadows).
Did anyone try to simulate different foliages levels and how did you do it?
I will have a look at water now.
If you have ideas about final scene, feel free to say (technical or look ideas).
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by Manou » Sun Sep 18, 2011 5:02 am
Hey, I'm trying to make some water, I followed nvidia tut : http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter07.html
I have some problems with refraction,
indice of refraction = 1.00 :
indice of refraction = 1.33 :
- Code: Select all
//Cg
void vshader(float4 vtx_position : POSITION, float3 vtx_normal : NORMAL, float4 vtx_texcoord0: TEXCOORD0, uniform float4 wspos_camera, uniform float4x4 trans_model_to_world, uniform float4x4 mat_modelproj, out float4 l_position : POSITION, out float4 l_texcoord : TEXCOORD0, out float3 l_refraction : TEXCOORD1, out float3 l_reflexion : TEXCOORD2, out float3 l_worldpos : TEXCOORD3, out float3 l_normal : TEXCOORD4) { l_position = mul(mat_modelproj, vtx_position); l_texcoord = vtx_texcoord0; // world space float3 w_position = mul(trans_model_to_world,vtx_position).xyz; float3 N = mul((float3x3)trans_model_to_world, vtx_normal); l_worldpos = w_position; l_normal = N; }
void fshader(float4 l_texcoord : TEXCOORD0, uniform float4 wspos_camera, uniform samplerCUBE k_cubemap : TEXUNIT0, in float3 l_refraction : TEXCOORD1, in float3 l_reflexion : TEXCOORD2, in float3 l_worldpos : TEXCOORD3, in float3 l_normal : TEXCOORD4, out float4 o_color : COLOR) {
float3 I,N; I = normalize(l_worldpos - wspos_camera); N = normalize(l_normal); float fresnel_bias, fresnel_power, fresnel_scale; fresnel_bias = 0.0001; fresnel_power = 1.0; fresnel_scale = 1; float3 reflection = reflect(I,N); float3 refraction_r, refraction_g, refraction_b; refraction_r = refract(I, N, 1.33); refraction_g = refract(I, N, 1.33); refraction_b = refract(I, N, 1.33); float4 tex_refraction; tex_refraction.r = texCUBE( k_cubemap , refraction_r ).x; tex_refraction.g = texCUBE( k_cubemap , refraction_g ).y; tex_refraction.b = texCUBE( k_cubemap , refraction_b ).z; float factor_reflection = fresnel_bias + fresnel_scale * pow(1 + dot(I, N), fresnel_power) ; float4 tex_reflection = texCUBE( k_cubemap , reflection ); o_color = lerp(tex_refraction, tex_reflection, factor_reflection); o_color = tex_refraction; }
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by Manou » Mon Sep 19, 2011 1:40 pm
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by Manou » Mon Sep 26, 2011 1:57 pm
Test with volumetric lighting + shadows :

-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by coppertop » Mon Sep 26, 2011 2:43 pm
I won't be creative, nor original at this, but both water shader and volumetric lighting look awesome. Just wanted to let you know you haven't lost the attention you undoubtedly deserve  .
-

coppertop
-
- Posts: 526
- Joined: Sat Apr 18, 2009 5:48 am
by Manou » Tue Sep 27, 2011 1:42 pm
Thanks man.
I'm trying to get some foliage, looks a bit cheap atm.
Will maybe look better with the old grass and hardware instancing.

-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by Manou » Thu Sep 29, 2011 2:44 pm
Update on the fern foliage :
(no lights or shadows)
96 quads
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by Manou » Mon Oct 03, 2011 9:15 pm
Update :
(blender render), hence the water having no shader applied.

-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by EdmundosTown » Tue Dec 06, 2011 4:55 pm
First, I'm so impressed with your work, but unfortunately the link just broke  .
When you have time, Could you re-update please? *-*
Thanks for coding for Panda3D.
-
EdmundosTown
-
- Posts: 26
- Joined: Mon Oct 17, 2011 1:36 pm
- Location: Mexico City, Mexico
by Manou » Wed Dec 21, 2011 8:11 am
EdmundosTown, the final panda is coming.
I'm rewriting the deferred shading system, I noticed problems in original code with normal maps when scaling models and the directionnal light code was wrong.
http://youtu.be/vICHdQpi-qg
(I changed the music  )
I still have problems with lights lagging frames behind when translating or zooming the camera.
I'm experimenting with optimizations now, with 50 points lights I have 40 fps.
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
by redpanda » Wed Dec 21, 2011 8:18 am
I don't know why someone disliked the video. keep up the good work.
I always feel jealous that I can't do anything like that, always wish Panda's shader generator would have more effects like these included.
-
redpanda
-
- Posts: 380
- Joined: Wed Aug 03, 2011 6:34 am
by Manou » Wed Dec 21, 2011 8:21 am
It was because of the jingle bells music I think, I'm having fun with AudioSwap sorry 
-

Manou
-
- Posts: 144
- Joined: Thu Jun 16, 2011 1:15 pm
- Location: France
-
Return to Code Snippets
Who is online
Users browsing this forum: No registered users and 0 guests
| | |