Jump to content

HideEntity and shadows


VeTaL
 Share

Recommended Posts

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).

Working on LeaFAQ :)

Link to comment
Share on other sites

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

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

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...

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

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... :P

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

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.

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...