Home Technical Talk

maya realtime lighting problem

hey all,

I'm having few problems with maya's realtime (viewport) lighting. I wanna use realtime lights rather than render to better display how my asset would be lit in a game. this is my first time lighting so please bear with the noob questions:

1. intersecting geo doesn't block light. the porch overhang isn't blocking light even though only the 3 front porch lights are on (selected).

prob1nj3.jpg

2. shadows aren't casting. this is probably just a matter of ticking a box somewhere but I can't find it!

prob2zv2.jpg

3. all my lights won't work at the same time. they each work individually when I select them and I have 'use selected lights' on, but when I select 'use all lights' only a few of them work.

prob3aih6.jpg
prob3buh1.jpg

4. high quality rendering turns the scene black.

[insert black image here]

the asset (the house) is sitting on a flat plane under a giant dome. all my lights are point lights with an intensity of 4.0-6.0 and a linear decay rate. not sure if that's the right kind and/or settings to use but that's what gave me the best results so far. I also have a directional light casting blue moon lighting over the entire scene but it only works when selected ><

Replies

  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    In my experience you are somewhat out of luck with what you want from maya, at least with default materials and the basic renderer.
    High quality usually just fails like that on consumer ATI cards, and only sorta works on Nvidia consumer cards.

    Realtime shadowing... I don't think I've ever gotten that working in maya. And geometry just plain DOESNT block light in the viewport, and only does in renders if you turn shadowing on. Raytrace is better, but depth map is quicker.

    What you CAN do is bake your lighting to a texture or vertices then add that lightmap on to the egeometry in a variety of ways.

    heres how(textures) (its gonna be a bit tedious but it will work):
    1: make a copy of your geometry.
    2: switch to rendering mode and select Transfer maps from the Lighting/shading menu.
    3: add one object to the target meshes section and its coresponding duplicate to the source section.

    Remove whatever default maps are there, and click the shading, or lighting button. Pick your texture size you want and click bake.
    DO this for each separate object in the scene, but be sure to put all the maps somewhere easy to find.

    More tedium: Create a material for each separate object. Import the lightmap for that object. Create a multiply node from the general utilities section under file->create.
    Link the diffuse file for the object to one input of the multiply node, and the lightmap to the other, then link its output to the color input of the object's material.
    Repeat for each object.

    Baking to verts should be simpler, though I forget the exact steps for that. The results won't be as crisp as light maps, but it should save a lot of time.

    If maya had better CGFX support I'm sure one of the assorted technical people around here would just write a shader that supported all this in real time.
  • rhoymand
    Options
    Offline / Send Message
    guh, I didn't know the maya viewport was so limited. I guess it'd be better to actually drop it in a game engine. thanks anyway vail.
  • bugo
    Options
    Offline / Send Message
    bugo polycounter lvl 17
    you do can have realtime working shadows, but it just works with spot light, so if you want, use shadow map in a spot light and go to lighting -> shadows.

    Sometimes lights get sorted out and doesnt link with objects. In this case i go to the object, select it an reapply the same material, light comes again. This unfortunaly its a bug.

    If I remember, maximum lights on maya viewport is 8 for each object, if you setup a light with quadratic you may get more lights showing because of decay. I didnt test this out yet, but that works on every engine, even in Unreal you cant have too many dynamic lights. What I would do on your case is baking vertex lighting as Vailias said and use 2 dynamic lights.

    8lightsrt0.jpg
  • Brice Vandemoortele
    Options
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    There is some easier way to bake lighting in maya (look for mental ray batch bake), but yeah maya realtime rendering is pretty limited. You can activate shadows for directional lights in highquality rendering, but they're unfiltered (not soft). The best to practice lighting is indeed a proper game engine, but baking lightmap is a pretty common solution and you can combine it with dynamic lighting with a cgfx in maya. I wrote one of these (http://boards.polycount.net/showthread.php?t=54839) but if you need a more simple one with just lightmaps or anything I'll be glad to help.
  • rhoymand
    Options
    Offline / Send Message
    until I get UT3 it seems like for now the closest I can get to realtime quality rendering it out using the lowest quality settings (maya software w/ preview quality).

    one final question though, how do I get a lamp/lightbulb to look like its actually emitting the light. placing the point light inside the geo blocks the light, and placing it outside casts shadows/doesn't light the opposite side.
  • bugo
    Options
    Offline / Send Message
    bugo polycounter lvl 17
    also, you should give a try on turtle, they have a 30 days trial, its amazingly fast. Also there is a plugin called chameleon for maya that its really good for vertex baking and editing.
  • rhoymand
    Options
    Offline / Send Message
    bugo wrote: »
    also, you should give a try on turtle, they have a 30 days trial, its amazingly fast. Also there is a plugin called chameleon for maya that its really good for vertex baking and editing.

    I tried turtle a while ago for baking AO maps. it's really good, but I didn't get into it cuz I wasn't really rendering anything back then. without a doubt my trial period is expired =/

    do ppl still use vertex shading/lighting even on current-gen games? wouldn't that conflict w/ dynamic lighting? or do they treat it more like a poor-mans AO?
  • bugo
    Options
    Offline / Send Message
    bugo polycounter lvl 17
    they do use vertex shading and it multiplies with dymanic.
Sign In or Register to comment.