|
Post by sbdjazz on Mar 8, 2017 13:27:26 GMT
Watch this vid: Moddb Rad vidAnd this pic: Why is my reflection so big when the object is so small? What am I doing wrong?
|
|
|
Post by WhyNot on Mar 8, 2017 14:55:24 GMT
Yeah I was confused with this back when you started out...
You see, How 3D Rad does reflections is by cubemap or it captures pictures of the six sides from the origin of your skinmesh. What you have to do is make the pictures be captured from the location of your camera every 60th of a second... that makes it look better..
For that use this script:
void Main() { //OBJ_0 = camera //OBJ_22 = Skinmesh Vector3 camloc; iObjectLocation(OBJ_0, camloc); iObjectEnvMapFocusSet(OBJ_22, camloc); } I'v not tested this script but it should work correct me if I'm wrong..
|
|
|
Post by indiedev on Mar 8, 2017 15:52:33 GMT
ah, no YRN, the reflect is based on face size, so big face=big reflect, and focus scripts only execute once at game start anyway.
solution: divide big surface into smaller faces, about 10m per face should do it.
|
|
|
Post by sbdjazz on Mar 8, 2017 19:28:01 GMT
Nope YRN is right about the Env Cubemap. And its position can be changed, (I just tested it) but setting the cubemap location to camera is not helping. Reflection size is independent of face size, but dependent on the cube map location.
|
|
|
Post by sbdjazz on Mar 8, 2017 20:02:54 GMT
UPDATE: YRN DUDE Thanks man for the initial hint. We don't have to put the cube map in the camera location but the (x, y) coordinates of the camera at the exact same distance below the surface of the road as the height of the camera from the road level. Suppose the height of the camera is (x) putting the reflecting surface as the reference (x=0) then we have to put the cube map location at (-x) bellow the surface and exactly bellow the camera. The result is (using a part of YRN's script) : Here the second yellow fish is providing the location for the cube map of that cube. This fish is not visible in reflections. I only need a script that sets the horizontal coordinates of the cube map to that of the camera while its height to negative (opposite) to the height of the camera with respect to that of the reflecting surface. Thanks in advance. Thanks for the initial hint YRN. It would be great if you or some one can build this script. This would help us a lot. Not just for me.
|
|
|
Post by indiedev on Mar 9, 2017 4:04:28 GMT
sb, i think you have gone on a wild goose chase here.
1st- the video you refer to does NOT use cubemap reflects! it uses a 'dynamic reflect/refract of the actual environment surrounding the object' set via refresh rate.
2nd-you are also not using a cubemap in those pics - take a look at file '000_em.dds' that is a cubemap! what you see in there is what's reflected on 0 refresh rate. you will notice there is no fish in that file, just sky.
3rd-while you may get the reflect you want with that script at the start, once you move it will have to be reset to new location, and like i said a focus script is only set ONCE at game start, the only way to update locations is by using the refresh rate.
trust me, i spent many hours on this when i 1st started out too, was a waste of time.
|
|
|
Post by sbdjazz on Mar 9, 2017 7:06:09 GMT
sb, i think you have gone on a wild goose chase here. 1st- the video you refer to does NOT use cubemap reflects! it uses a 'dynamic reflect/refract of the actual environment surrounding the object' set via refresh rate. 2nd-you are also not using a cubemap in those pics - take a look at file '000_em.dds' that is a cubemap! what you see in there is what's reflected on 0 refresh rate. you will notice there is no fish in that file, just sky. 3rd-while you may get the reflect you want with that script at the start, once you move it will have to be reset to new location, and like i said a focus script is only set ONCE at game start, the only way to update locations is by using the refresh rate. trust me, i spent many hours on this when i 1st started out too, was a waste of time. Don't know about you but YRN is right. And hell yeah did it work. I only need a script to adjust the height of the 2nd skin mesh. I tested it on my open world racing game.
|
|
|
Post by WhyNot on Mar 9, 2017 15:26:24 GMT
OK, Bros just the thing is Me and indiedev both are correct... So, according to my knowledge cube-map works is you specify a image (i.e 000_em.dds) in your skinmesh folder And, The Dynamic reflections also work the same way but rather than using a image It captures images (every Xth of a second) that you specify. It's the "Reflection Update Rate or something like that on your skinmesh window". The way that script works is it set the cube-mapish reflection's capture location of camera every time the script is performed. As, indiedev said For moving object It's a bit tricky for it to work perfectly The object must not be moving on the y-axis (up).
|
|
|
Post by indiedev on Mar 10, 2017 4:49:22 GMT
setting the cubemap location to camera is not helping. the key issue here is that the focus script only works for static reflects [refresh=0.01] as you saw, dynamic cam refresh rates higher than that override the focus script, and by not linking it to the cam as you have, you basically bypassed the refresh rate, making it a static not dynamic reflect. try driving to the other side of a long map and you will see it is still focused at starting point. if that's what you wanted then yes the script will work for static reflects, but for a racer you mostly want dynamic.
|
|
|
Post by sbdjazz on Mar 10, 2017 8:29:10 GMT
I got it working just the way I needed by linking the script to a second skin mesh rather than the cam chase and setting the env map refresh rate > 0. Someone please give me a script so that I can change the y axis location of that skin mesh as required. Thanks in advance 😊.
|
|
|
Post by GH Games on Mar 10, 2017 9:15:46 GMT
Not really sure what's going on here but here is a Script I just made that seems to work okay. Link it to the SkinMesh and change the "number" to whatever you want. Note that this number will be added (or taken away) from the initial location. Not sure if it will work for you or if it's what you need but I hope it helps int number = -2; //This is a good starting number for testing. Remove the - to see it work another way
Vector3 loc; void Main() { iObjectLocation(OBJ_0,loc); //Get the initial location loc.y += number; //Voodoo the initial location iObjectLocationSet(OBJ_0,loc); //Set the new location iScriptStop(); //HALT! }
This example places the SkinMesh -2 on the Y axis from 0,0,0 (Where it started). (If you do end up using this Script, please remove the comments xD)
|
|
|
Post by sbdjazz on Mar 11, 2017 13:32:20 GMT
Tanks man, I will surely test it and tell you about it.
|
|
|
Post by GH Games on Mar 12, 2017 12:15:44 GMT
Did you try it mate? How did it go?
|
|
|
Post by sbdjazz on Mar 12, 2017 18:05:56 GMT
I wish I could show you a video. But I am not permitted by my team to disclose spoilers yet. I will show you, but the actual finished game.
|
|
|
Post by GH Games on Mar 12, 2017 18:26:43 GMT
Does the Script work at least? That's a yes or no answer no team permission required
|
|
|
Post by sbdjazz on Mar 13, 2017 4:49:32 GMT
Sorry, I mean it worked. And I wish I could show you a video of that. That's what I meant.
|
|
|
Post by GH Games on Mar 13, 2017 13:11:10 GMT
Okay good good, just checking
|
|
|
Post by indiedev on Mar 14, 2017 12:54:41 GMT
if that [or any other script you can throw at it] worked, it will be for static reflects only, so for those of us wanting to focus dynamic reflects, it's of no use at all, but to each their own i guess...
|
|
|
Post by sbdjazz on Mar 14, 2017 15:46:39 GMT
You will see it for yourself on a beta of the game or I will make a small sample project to show it off. The fact that my PC is incapable of capturing videos directly from screen makes it harder.
|
|
|
Post by GH Games on Mar 14, 2017 15:49:58 GMT
Why can't you capture your screen?
|
|