VeTaL Posted September 7, 2010 Share Posted September 7, 2010 First, can i hide entity so i could see only shadow, not model (like for character controller model in FPS). Second, can i hide shadow from first light source and render only from second? (we want to reproduce some shadow anomalies: a shadow of one entity must be differ from other entities shadows). Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted September 7, 2010 Share Posted September 7, 2010 well i dont know about the second one, but this is how I would do the first one: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) function object:DrawEach(camera) if camera==fw.main.camera then GetChild(object.model,1):Hide() else GetChild(object.model,1):Show() end end end Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
macklebee Posted September 7, 2010 Share Posted September 7, 2010 and actually, that does kind of do what you are wanting for the second part as well... that script only shows the shadows that are created from a directional light and not from point or spot lights... i dont know why though... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted September 7, 2010 Author Share Posted September 7, 2010 I'm lost in converting this to C++... Do i need to overload render function for entity that i want to show a shadow? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted September 7, 2010 Share Posted September 7, 2010 I'm lost in converting this to C++... Do i need to overload render function for entity that i want to show a shadow? well i assume you would have to use the new entity draw callback that was added here recently... though i am not too sure of the syntax... and especially for c++... i would assume there are alot of semicolons and possibly a 'void' in there... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted September 8, 2010 Author Share Posted September 8, 2010 Okay, so how its done in some video demos (i saw on youtube demos of fps, where player shoots from gun... as i remember, there were shadow of him)? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted September 8, 2010 Author Share Posted September 8, 2010 Hey... maybe this can be in camera properties? Not to render the player, from wich camera is looking, but render his shadow. (in 3d gamestudio there is possibility like this) Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Flexman Posted September 8, 2010 Share Posted September 8, 2010 Well, just to throw this into the mix. The material can use a shader with the "invisible.frag" which won't render, but the shadow shader can use your standard "mesh_shadow.frag" which will render (should render) the shadow. So you have two materials, one to render the material you can see for 3rd person, paint it with the invisible material for first person. This is how I intend to do it for our pilot character. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
VeTaL Posted September 8, 2010 Author Share Posted September 8, 2010 Ahh, that exact what i need on first question ^^ Imo, this also can be added to FAQ. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.