DrawFeature() ?
Moderator: Moderators
DrawFeature() ?
Is there a callin like DrawUnit? Except for features? Because Im having a bit of difficulty applying jK's wonderful vertex shader to feature trees.
Re: DrawFeature() ?
someone made a post and deleted it :p
And no, features and units are handled differently in the engine. There isn't a lua controlled rendering pass for features. For more info check my history, I explained the details of this in the past.
And no, features and units are handled differently in the engine. There isn't a lua controlled rendering pass for features. For more info check my history, I explained the details of this in the past.
Re: DrawFeature() ?
Yeah, lucky I read it before it got deleted, but I wanted to know if having no texture wasnt really an issue if the unit got textured by the fragment shader anyway, no? I might be saying stupid things, so stop me if I am.
Re: DrawFeature() ?
You mean gl.Feature().
You can bind the textures yourself before calling it
You can bind the textures yourself before calling it
Code: Select all
gl.Texture(0,"%"..(-featureDefId)..":1")
gl.Texture(1,"%"..(-featureDefId)..":2")
gl.Feature(featureID)
gl.Texture(0,false)
gl.Texture(1,false)
Re: DrawFeature() ?
Ah, that would provide a path- just make the Feature invisible by default, use a shader or whatever.
However, it'd cast no shadow and the geometry would still run through the ARB shader, so it's not a cheap way to do things.
However, it'd cast no shadow and the geometry would still run through the ARB shader, so it's not a cheap way to do things.
Re: DrawFeature() ?
erm what? both wrong.Argh wrote:However, it'd cast no shadow and the geometry would still run through the ARB shader, so it's not a cheap way to do things.
PS: it would SLOW!
Re: DrawFeature() ?
zwzsg hit delete after he wrote:There is. But the texture is not applied. Please have a look at http://springrts.com/phpbb/viewtopic.php?f=11&t=18959Beherith wrote:Is there a callin like DrawUnit? Except for features? Because Im having a bit of difficulty applying jK's wonderful vertex shader to feature trees.
jK also mentionned me in IRC a way to manually calculate the texture index used by a feature.
Beherith wrote:what just happened here?
I deleted it because I realised shortly after posting that I was doubly irrelevantjK wrote:someone made a post and deleted it
- Beherit request was about the engine calling a Lua function for every feature that's placed on the map.
- My answer was about Lua calling the engine to render feature that aren't there.
- Call-ins(=Engine->Lua) != Call-outs(=Lua->Engine)
- Not drawing what exists != Drawing what not exist
Re: DrawFeature() ?
Hmm, I thought of a workaround to this: I add features on the map, that are empty objects with a hitsphere, then have lua draw units on each feature which disappear when the feature is reclaimed/destroyed.
Does this make sense?
Does this make sense?
Re: DrawFeature() ?
featureDef.drawtype = -1
+
featureDef.collisionVolume... = ...
-> engine won't draw a model at all
+
featureDef.collisionVolume... = ...
-> engine won't draw a model at all
Re: DrawFeature() ?
Hmm, that sounds very good, in fact then I can add LOD-ing to the features as well...
Re: DrawFeature() ?
Oh, you can do that? My apologies then, you're absolutely right, that's a lot cleaner. It wouldn't draw to the shadowmap, though, then... oh well.featureDef.drawtype = -1
+
featureDef.collisionVolume... = ...