Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Actor loses texture when i have Fog enabled.  (Read 1975 times)
Chris_SHX
Community Member
*
Posts: 14


« on: December 22, 2009, 01:35:47 PM »

Hello,

My render loop is:

Code:
pEngine->Clear();

ohp->pScene->RenderAll(true,true);
ohp->pScene->FinalizeShadows();

        ohp->pAtmos->Fog_Enable(false);
ohp->pAtmos->Atmosphere_Render();
ohp->pAtmos->Fog_Enable(true);

pEngine->RenderToScreen();

When using it, my actor is black
But when i comment lines with FogEnable(...) then it's working good

Is there any solution for this ?

Regards,
Chris
Logged
Aki
Customers
Community Member
*****
Posts: 82


« Reply #1 on: December 22, 2009, 01:48:58 PM »

Are you using a special lighting mode? IE: Normal mapping, parallax mapping

Perhaps post the actor's creation code. Fog and special lighting might make the TV3D shader to not work with both on.
Logged

jviper
Community Member
*
Posts: 2127

Discipline in training


« Reply #2 on: December 22, 2009, 02:21:27 PM »

Hmmm, what else do you have on screen that is influenced by the fog? Do all those other objects (that are influenced by the fog) go black, or just the actor? What are your fog settings?
Logged

JAbstract.....Don't just imagine, make it happen!
Chris_SHX
Community Member
*
Posts: 14


« Reply #3 on: December 22, 2009, 02:29:43 PM »

I'm not using any special lighting.

The actor creation code is a script:

Code:
load_actor  mob_menu01 models/vip.tva 3
set_actor_pos  mob_menu01 35 7 100
set_actor_rot  mob_menu01 -90 130 0
set_actor_params  mob_menu01 1   1   2   0 128 1
set_actor_scale  mob_menu01 0.5 0.5 0.5

First line loads actor with specified name "mob_menu01", all other commands are using this name to operate on target object.

1st param - command, as well
2nd param - object name
3rd param - path to TVA file
4th param - culling mode value (3 means BACK_CULL)

Script parser code:
Code:

....
CTVActor* mesh = pScene->CreateActor(mesh_name);
mesh->LoadTVA(path,true,true);
mesh->SetCullMode((cCONST_TV_CULLING)culling_mode);

set_actor_pos, set_actor_rot - i have nothing to say

Fourth line is setting up actor's parameters:
1st param - command
2nd param - object name
3rd param - use shadows ?
4th param - use additive shadows ?
5th param - lighting mode value (2 means managed lighting mode)
6th param - use alpha testing ?
7th param - alpha testing reference value
8th param - use depth write ?
9th param - group number for alpha testing

And the snippet of script parser code:
Code:

....
CTVActor* mesh = glb.GetActor (mesh_name);
if (mesh)
{
mesh->SetShadowCast(shadowcast==1, additive==1);
mesh->SetLightingMode((cCONST_TV_LIGHTINGMODE)lightingmode);
mesh->SetAlphaTest(usealpha==1,referencealpha,dbwrite==1);
}

jviper, actor only

Fog settings:
Code:
set_fog_parameters  1 200 900 1 1 1 1

Fog is enabled.  Fog near: 200, Fog Far: 900.  Density is 1. Fog color is white.
« Last Edit: December 22, 2009, 05:51:39 PM by Chris_SHX » Logged
jviper
Community Member
*
Posts: 2127

Discipline in training


« Reply #4 on: December 23, 2009, 07:56:36 PM »

hmmm, what's the actormode for the actors? shader? try cpu.
Logged

JAbstract.....Don't just imagine, make it happen!
akd
Customers
Community Member
*****
Posts: 53


WWW
« Reply #5 on: December 28, 2009, 05:45:38 AM »

I got the same problem (with lastest c# TV3D dll)

Code:
_atmosphere.Fog_SetType(CONST_TV_FOG.TV_FOG_LINEAR,CONST_TV_FOGTYPE.TV_FOGTYPE_VERTEX);

Fog is applied on actors (see pic 1)

Code:
_atmosphere.Fog_SetType(CONST_TV_FOG.TV_FOG_LINEAR, CONST_TV_FOGTYPE.TV_FOGTYPE_RANGE);
Code:
_atmosphere.Fog_SetType(CONST_TV_FOG.TV_FOG_LINEAR, CONST_TV_FOGTYPE.TV_FOGTYPE_PIXEL);

Fog is okay (not applied on actors) (see pic 2)

Pic 1:


Pic 2 :

Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4944


WWW
« Reply #6 on: January 12, 2010, 08:03:09 AM »

Some fog modes unfortunately don't work on mesh/actor rendered with a shader (especially recent shader models 2.0 or 3.0).

Besides, in DX10 you won't be able to use fog like that, it will have to be included in the pixel shader (which is a shame because you have to compile a version of the shader with fog and without for example.. it's not good for shader count explosion !)
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
nicolas
Community Member
*
Posts: 157


« Reply #7 on: February 12, 2010, 08:16:14 AM »

Will you still be able to use the TV3D fog in DX10 like we do it now, if you use CPU for the actormode?
Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4944


WWW
« Reply #8 on: February 15, 2010, 08:00:56 AM »

No, fog will have to be entirely written in the shader
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks