Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Dynamic character reflections(Actor3D). Looking for possible solutions.  (Read 5322 times)

0 Members and 1 Guest are viewing this topic.

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile

Hello.
I'm looking for a way to create dynamic character reflections on the floor. Characters are Actor3Ds.
In ideal case, character's reflections must be distorted, dynamic and blurred. :)
However, simple dynamic reflections (like mirrors) would be fine.

I've already thought about several possible solutions. It looks like none of them can be implemented in current version. Here they are:
1) Mirror actor horizontally, set his material to something like floor's specular color and render.
Problem: no "render 3D object method". In other words, it is impossible to render any object with a user-defined transformation.

2) Render scene to texture, flip the texture. Same problem as in first solution.

3) Make a blurred sprite, attach to the actor's feet.
Problem: sprites doesn't know anything about 3D position, and will not be scaled according to the distance. Anyway, there will be no distortions, a lot of problems with entites blocking\non blocking the sprite, additional artwork is required. Even if implemented, this method may produce ugly visual result on the edges of sprite (where alpha channel drops to zero) because of filtering.

4) (Improved version of solution 3). Store hidden reflection sprite in actor(somehow), store a "normal map" in the entity that is reflective, perform software rendering with distortion to clip the sprite by entity's shape and distort it using "normal map".
Problems: because camera data is not accessible, it will be difficult to scale sprites, possible workarounds include defining copies of camera data in scripts, and that will most certainly lead to serious problems, when changing scene.
Also, this method will probably bring engine to knees due to the CPU load, entities in scene will need great amount of additional artwork, and even if implemented, this method may produce ugly visual result due to the lack of filtering/other reasons.

Is there ANY way to make dynamic character reflections in current version of WME?
Logged

leucome

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 86
    • View Profile
    • Leucome Games
Re: Dynamic character reflections(Actor3D). Looking for possible solutions.
« Reply #1 on: October 07, 2006, 10:50:08 PM »

Ok ... maybe solution 4 ...  Make a second actor  who be under the floor (mirored) but have same animation than the main actor
make it folow the main actor using  SkipTo3d(actor.PosX,actor.PosY,actor.PosZ) maybe you will need to use DROP_TO_FLOOR = FALSE and triger the same animation using PlayAnim to get a good relust you will need to place the script in a quick loop maybee under 20 millisecond ...
And like you said use a différent material for it  something blured with an alpha channel to make it tranparent .

Or maybe the second one could be directly included in the main actor files...

but i dond know for the distortion ...
« Last Edit: October 07, 2006, 11:14:04 PM by leucome »
Logged
Look my Site ——► http://news.leucome.ca

leucome

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 86
    • View Profile
    • Leucome Games
Re: Dynamic character reflections(Actor3D). Looking for possible solutions.
« Reply #2 on: October 07, 2006, 11:15:53 PM »

After reread your post i am thinking  i just said the same thing than your first solution ...  :-\
Logged
Look my Site ——► http://news.leucome.ca

leucome

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 86
    • View Profile
    • Leucome Games
Re: Dynamic character reflections(Actor3D). Looking for possible solutions.
« Reply #3 on: October 08, 2006, 12:17:42 AM »

I tried it just to see   

A mirrored model placed directly inside the main actor .x file using a tranparent texture slightly deformed by a sponge effect and a bur.




Note:   We cant use stencil shadow with this because the flor hide the reflection placed under it ...
          We can use projected shadow but we get 2 shadow in oposit direction ...
          Maybe a completly diferent actor could be a way to resolve shadow trouble ... or only use no shadow in reflextion scene ...anyway
Logged
Look my Site ——► http://news.leucome.ca

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: Dynamic character reflections(Actor3D). Looking for possible solutions.
« Reply #4 on: October 08, 2006, 09:18:51 PM »

Ok ... maybe solution 4 ...  Make a second actor  who be under the floor (mirored) but have same animation than the main actor
make it folow the main actor using  SkipTo3d(actor.PosX,actor.PosY,actor.PosZ) maybe you will need to use DROP_TO_FLOOR = FALSE and triger the same animation using PlayAnim to get a good relust you will need to place the script in a quick loop maybee under 20 millisecond ...
And like you said use a différent material for it  something blured with an alpha channel to make it tranparent .

Or maybe the second one could be directly included in the main actor files...

but i dond know for the distortion ...
Well, thanks for the suggestion (although I already have thought about that), but, unfortunately, this will not work...
The main question/problemt is - how to flip actor/make mirror model? It looks like WME handles all transformation problems automatically, and the part of engine where matrix operations happens, can't be accessed from the script/plugin. It is possible to create second actor, sybchronize him with original, etc., but I see no way to flip him.
Second problem:
Using transparent texture on actor will not work. The actor will look ugly, because we well certainly see polygons on the other side of actor, also, if Z-buffering is enabled (and it is enabled by default, isn't it?), there will be additional problems in conjuction with alpha-blending.. The best solution for this is to render actor to texture (create some kind of dynamic sprite), and use this texture with any color/alpha values you wish.
Third problem: Z-buffering + alpha blending. (already mentioned).

And, thanks for those words about shadows. I've been thinking about reflections and completely forgot about all problems that the shadows will create with reflected surfaces...

The only solution, that could solve all of these problems (I think) is to create two-step render (the way ATI did it's "Nature" demo). I suppose this can't be implemented in WME right now. :(
Logged

leucome

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 86
    • View Profile
    • Leucome Games
Re: Dynamic character reflections(Actor3D). Looking for possible solutions.
« Reply #5 on: October 09, 2006, 05:56:49 AM »

I have fliped the actor in 3ds max for the test ... And it is not a good solution for a whole game but it could be tweeked for a couple of scene.  On a relatively dark floor the back poly are almost unnoticeable...

You said 2 time this will not work ... I think you cant see the picture attached to the post because we can see it work relatively good and it look more convincing while moving..

I hope to see a better solution in the future.
« Last Edit: October 09, 2006, 06:15:49 AM by leucome »
Logged
Look my Site ——► http://news.leucome.ca

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: Dynamic character reflections(Actor3D). Looking for possible solutions.
« Reply #6 on: October 09, 2006, 10:53:13 AM »

I have fliped the actor in 3ds max for the test ... And it is not a good solution for a whole game but it could be tweeked for a couple of scene.  On a relatively dark floor the back poly are almost unnoticeable...

You said 2 time this will not work ... I think you cant see the picture attached to the post because we can see it work relatively good and it look more convincing while moving..

I hope to see a better solution in the future.
Thanks a lot! :) I really didn't see that picture - graphic is turned off in browser.
Logged
 

Page created in 0.04 seconds with 24 queries.