LightMesh is Slow?

Blitz3D Forums/Blitz3D Programming/LightMesh is Slow?

KuRiX(Posted 2005) [#1]
Hello, i am using lightmesh to adjust the ilumination of my models to the lightmaps. The problem is that i am having several drops of fps when lightmeshing 4 or more models.

Is this command so slow?


Damien Sturdy(Posted 2005) [#2]
Yes. The command will be slow as it is doing the equivalent of:
<calculate light>

For sf=1 to countsurfaces(mesh)
Surf=getsurface(mesh,sf)
for vt=0 to countvertices(surf)-1
vertexcolor.....
next
next

:(

Theres alot of stuff thats slow.
Hideentity is slow dispite the apparent speed up a few years back, Blitz Animation would be so much faster with a few optimisations here and there :/

Anyway, I digress... Yes. Lightmesh is slow :(


KuRiX(Posted 2005) [#3]
Ohhh, accesing every vertex!!! So it needs the vertex color flag.

Very bad news then...

By the way, Cygnus, thanks, you are responding all my posts!

P.D: Are there any list of commands that are slower than they should?


KuRiX(Posted 2005) [#4]
Ok, so, any other way to change the ilumination of a mesh to get affected by the lightmap?


Tracer(Posted 2005) [#5]
I simply darken the entire mesh if it enters a shaded area (entitycolor).

Tracer


KuRiX(Posted 2005) [#6]
mmm, but entitycolor use the vertexcolor? can i use entitycolor if the mesh is textured?

I need to try that...


Damien Sturdy(Posted 2005) [#7]

Are there any list of commands that are slower than they should?



Hideentity seems to struggle with animated meshes, though animation its self is slow. actual PICKing commands, Anyting that will modify an entire mesh at vertex level (mesh commands not entity); slow I *think*. 2D=SLOWW. lol

Theres Plenty of stuff about it lying around here..


Entitycolor is plenty fast for this use, and you can use it with a textured mesh, too.

[edit]
Oh, and no problem :) Community helps me, I help the community. :D


KuRiX(Posted 2005) [#8]
I change EntityColor with a textured mesh but doesn't seem to work... need to be active vertex colors???


Damien Sturdy(Posted 2005) [#9]
Hmm, there are entityFX flags you may want to play with, i dont remember the values there but the Vertex Colours flag may need Playing with :)

Best thing mate, just play around :D


t3K|Mac(Posted 2005) [#10]
i dont get entitycolor to work with anim meshs. any hints?


KuRiX(Posted 2005) [#11]
Not sure but perhaps you will need to search the child you want to change the color.

Or if you want to change the entire mesh do it recursively through the hierarchy with countchildren and getchild.


jfk EO-11110(Posted 2005) [#12]
t3K - use this: http://www.blitzbasic.com/codearcs/codearcs.php?code=1170

KuRiX:
EntityColor should work with textured meshes. The default color is 255,255,255. Maybe you need to use EntityFX to allow this. If it is a B3D Mesh and Vertex Color is "disabled" in the Mesh File, you maybe not gonna be able to override it with EntityFX, instead make sure to save the B3D File with other settings.


KuRiX(Posted 2005) [#13]
Yes, i solved this long time ago, but forgot to answer here xD

thanks anyway!


t3K|Mac(Posted 2005) [#14]
thanks jfk. now its working - but now i know why its so slow ;)