PDA

View Full Version : Static Mesh Rendering Issue



GS-0
05-28-2010, 09:53 PM
So I am having a strange issue with static meshes as a sub object. They render perfectly in the editor, but when ingame they render pitch black as if they had no LightEnvironment. After searching, yes I used the search first, I have uncovered similar problems, but those dealt with missing light environments. Before you decide to give me a link to Google and some harsh words, consider this:
I have experimented and searched for answers, but nothing seems to work. Also, I am still a novice at UnrealScript. To help explain my problem, I have pictures and code "snippets":

http://img.photobucket.com/albums/v240/geminijunodeluxe/Untitled-1-42.jpg


class StateTrigger extends Actor
placeable;

var DynamicLightEnvironmentComponent LightEnvironment;
var StaticMeshComponent BaseX,Nub,Thing;

defaultproperties
{
Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
bSynthesizeSHLight=TRUE
bIsCharacterLightEnvironment=TRUE
bUseBooleanEnvironmentShadowing=FALSE
End Object
Components.Add(MyLightEnvironment)
LightEnvironment=MyLightEnvironment

Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0
StaticMesh=StaticMesh'NEC_Wires.SM.Mesh.S_NEC_Wire s_SM_Pipecap01'
LightEnvironment=MyLightEnvironment
End Object
Components.Add(StaticMeshComponent0)
BaseX=StaticMeshComponent0

Begin Object Class=StaticMeshComponent Name=StaticMeshComponent1
StaticMesh=StaticMesh'NEC_Wires.SM.Mesh.S_NEC_Wire s_SM_Wireconnector01'
LightEnvironment=MyLightEnvironment
End Object
Components.Add(StaticMeshComponent1)
Nub=StaticMeshComponent1

Begin Object Class=StaticMeshComponent Name=StaticMeshComponent2
StaticMesh=StaticMesh'LT_Light.SM.Mesh.S_LT_Light_ SM_Light01'
LightEnvironment=MyLightEnvironment
End Object
Components.Add(StaticMeshComponent2)
Thing=StaticMeshComponent2

Begin Object Class=CylinderComponent Name=CylinderComponent0
CollideActors=true
CollisionRadius=+0040.000000
CollisionHeight=+0040.000000
End Object
Components.Add(CylinderComponent0)
CollisionComponent=CylinderComponent0

bCollideActors=true
bStatic=true
bMovable=false
bEdShouldSnap=true
}

As you can probably tell from the code above, I am currently following the Mastering Unreal V3 tutorial on the UDN. By the way, I am currently using the May build of the UDK.

Any help is very much appreciated, thank you.

OmegaMinus1
05-29-2010, 02:29 AM
bStatic=True needs to be bStatic=False hence DynamicLightEnvironmentComponent

http://www.bitSlap.me/StateTrigger.png

GS-0
05-29-2010, 02:55 AM
Thanks a lot OmegaMinus1, it works great. I completely forgot about those defaults at the end. Clearly, I need to learn how to experiment better. What was throwing me off is that it rendered fine in a realtime perspective viewport in the editor.

This does lead me to another question though. How does one make a static actor lit? I tried no light environment and bStatic=true, but it's still black. I also tried creating a LightEnvironmentComponent vs a Dynamic one, but that didn't work either.

Either way, thanks again OmegaMinus1.

OmegaMinus1
05-29-2010, 03:32 AM
bUsePrecomputedShadows=True //Turns on LightMaps
LightingChannels=(bInitialized=True,Static=True) //Set to static and activate


class StateTrigger extends Actor
placeable;

var StaticMeshComponent BaseX,Nub,Thing;

defaultproperties
{
Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0
StaticMesh=StaticMesh'NEC_Wires.SM.Mesh.S_NEC_Wire s_SM_Pipecap01'
LightingChannels=(bInitialized=True,Static=True)
bUsePrecomputedShadows=True
End Object
Components.Add(StaticMeshComponent0)
BaseX=StaticMeshComponent0

Begin Object Class=StaticMeshComponent Name=StaticMeshComponent1
StaticMesh=StaticMesh'NEC_Wires.SM.Mesh.S_NEC_Wire s_SM_Wireconnector01'
LightingChannels=(bInitialized=True,Static=True)
bUsePrecomputedShadows=True
End Object
Components.Add(StaticMeshComponent1)
Nub=StaticMeshComponent1

Begin Object Class=StaticMeshComponent Name=StaticMeshComponent2
StaticMesh=StaticMesh'LT_Light.SM.Mesh.S_LT_Light_ SM_Light01'
LightingChannels=(bInitialized=True,Static=True)
bUsePrecomputedShadows=True
End Object
Components.Add(StaticMeshComponent2)
Thing=StaticMeshComponent2

Begin Object Class=CylinderComponent Name=CylinderComponent0
CollideActors=true
CollisionRadius=+0040.000000
CollisionHeight=+0040.000000
End Object
Components.Add(CylinderComponent0)
CollisionComponent=CylinderComponent0

bCollideActors=true
bStatic=true
bMovable=false
bEdShouldSnap=true
}

GS-0
05-29-2010, 04:08 AM
Thanks yet again, I got that implemented and it works just fine. You seem to know your stuff very well, I don't suppose you have any tips for a guy who just started UnrealScript two days ago and absolutely must teach himself to master it? I watch/read every tutorial I come across and have the UnrealScript Reference bookmarked, but finding documentation on matters such as this is proving difficult for me.

Thanks for all the help.

OmegaMinus1
05-29-2010, 04:55 AM
http://www.amazon.com/UnrealScript-Game-Programming-All-One/dp/1598631489/ref=sr_1_1?ie=UTF8&s=books&qid=1275120880&sr=1-1

Good read. more syntax/etc.. than make my game.

donamin
03-21-2011, 06:46 AM
hello guys. i have the same problem. maybe you could help me with that:

http://forums.epicgames.com/showthread.php?t=769809

i'll appreciate if you can help :)