How to make it faster?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

REPLY TO THREAD
 
Thread Tools Display Modes
  07 July 2015
(
 	delete objects
 	
 	node = box()
 	addmodifier node (VoroFrag numChunks:50 selInFaces:on )
 
 	converttopoly node
 	polyop.deletefaces node node.selectedfaces
 	
 	polyop.createShape node (polyop.getopenedges node) smooth:false name:"holo"
 	$holo.render_displayRenderMesh = true
 	$holo.thickness = 1.0
 	
 	delete node
 )
__________________
Jorge Rodríguez
PolyTools3D
 
  07 July 2015
Originally Posted by PolyTools3D:
Pulldownit seems to have a more comprehensive set of tools for fracturing.


RayFire is much more powerful then pulldownit
i've watched all demonstration videos from http://rayfirestudios.com/... it can a lot.
the only thing is probably not very well handling of normals.
 
  07 July 2015
rayfire is fast... it's about 10 times faster than i have now. but my current solution is about 50-50 of built-in and custom code. probably rayfire makes 100% of slice, cut, and cap itself.

for example... there is built-in MeshCapper... but i found its slow. and wrote my own. my is about 10 times faster than built-in.

so there is now way to get the same performance as rayfire by using pure built-in max solutions.

it shows once again that the MCG is the poor man's plays.
 
  07 July 2015
the performance doesn't really bother me. there is no really difference between 2 secs and 10. both are not real-time.
i'm not sure that something cool can be made by easily playing with a modifier's parameters.
so 2 and 10 secs don't make difference in this case
 
  07 July 2015
I really don't think this technique of slicing and capping is the best approach for real time solution.
RayFire Voronoi performs quite well up to 500-750 chunks on my end. Not real time, but pretty comfortable to work with.

If you gather the topological data from the Voronoi modifier, Rebuilding a mesh with 500 chunks including SG, MatID, etc. takes around 80ms in MXS so perhaps finding a fast algorithm to build the Voronoi cells data would make it much faster than slicing and capping.
__________________
Jorge Rodríguez
PolyTools3D
 
  07 July 2015
I played around with this about a year ago but adding the RayFire_Asperity() to give may inside cuts detail. Code is not the best was just playing around. I would like to port somthing like this to the sdk but not use any third party plugins.

I see in mnmesh there is a mm->slice has some good options.

Dennis your code looks like a great starting point. Thanks for that!

here is the old crap code. It does work well but is slow and just a first write.


Fn FN_GlowFrag Frag_Objs Break_Type Inside_D Second_Facture Bake_It Detail_Amount FRAG_SIZE MAT_ID = (
	if Frag_Objs.count > 0 do(
		 progressStart "Make Me Some GlowFrags!!!" ------------------------
		actionMan.executeAction 0 "40087"  -- Edit: Hold
		Size_Array = #()
		Size_Short = #()
		Large_Frags = #()
		Largest_Size = 0
		Smallest_Size = 9999999999
		max modify mode
		Rig_Mod = MassFX_RBody()
		Rig_Mod.type = 2
		Rig_Mod.manualSetup = on
		Rig_Mod.switchType = on
		Rig_Mod.switchTypeAtFrame = random 5 20
		Rig_Mod.materialID = -1565614346
		Rig_Mod.density = 8
		Rig_Mod.Mass = 3
		Rig_Mod.staticFriction = 0.5
		Rig_Mod.dynamicFriction = 0.2
		Rig_Mod.bounciness = 0.1
		Frag1_Mod = RayFire_Voronoi()
		Frag1_Mod.pc_type = 0
		Frag1_Mod.pc_numpoints = FRAG_SIZE
		Frag1_Mod.seed = (Random 0 9999)
		Frag1_Mod.Fragment = on
		Frag1_Mod.matID = MAT_ID
		if Break_Type == 1 then(
			Frag1_Mod.prescale_z = (Random 5 20)
		)
		else(
			Frag1_Mod.prescale_z = (Random 93 95)
			Second_Facture = true
		)
		subobjectLevel = 0
		Frag2_Mod = RayFire_Voronoi ()
		Frag2_Mod.pc_type = 1
		Frag2_Mod.Fragment = on
		if Break_Type == 1 then(
			Frag2_Mod.prescale_z = (Random 5 20)
			Frag2_Mod.pc_numpoints = (FRAG_SIZE / 4)
		)
		else(
			Frag2_Mod.prescale_z = 97
			Frag2_Mod.pc_numpoints = 100
		)
		Frag2_Mod.seed = (Random 0 9999)
		Frag2_Mod.matID = MAT_ID
		subobjectLevel = 0
		Detail_Mod = RayFire_Asperity() 
		Detail_Mod.triSizeMode = 1
		Detail_Mod.edgeLengthAbs = Detail_Amount
		Detail_Mod.selectionNoiseEnabled = on
		Detail_Mod.noiseAmountLock = off
		Detail_Mod.noiseAmountX = (Random 0.9 2)
		Detail_Mod.noiseAmountY = (Random 0.9 2)
		Detail_Mod.noiseAmountZ = (Random 0.9 2)
		progressUpdate 20
		for i = 1 to Frag_Objs.count do(
			addModifier Frag_Objs[i] Frag1_Mod
			Frags = RFMxs.explodeToElements Frag_Objs[i] deleteOriginal:true suffix:("GlowFrag_")
			for f = 1 to Frags.count do(
				Frags[f].wirecolor = (color (random 0 255) (random 0 255) (random 0 255))
				size_O = distance Frags[f].max Frags[f].min
				append Size_Array size_O
			)
			progressUpdate 40
			if Inside_D == True do(
				addModifier Frags Detail_Mod
				---------progressUpdate 80
				Select Frags
				macros.run "Modifier Stack" "Convert_to_Mesh"
			)
			Sort Size_Array
			Start_Num = Size_Array.count / 2
			Start_Num = floor Start_Num as integer
			Start_Num = Size_Array.count - Start_Num
			for AC = Start_Num to Size_Array.count do(
				append Size_Short Size_Array[AC]
			)
			for fs = 1 to Frags.count do(
				size_O = distance Frags[fs].max Frags[fs].min
				for ffs = 1 to Size_Short.count do(
					if size_O == Size_Short[ffs] do(
						append Large_Frags Frags[fs]
					)
				)
			)
			progressUpdate 40
		)
		if Second_Facture == True do(
			for LF = 1 to Large_Frags.count do(
				T_Frags = #()
				New_Size = random 2 4
				Frag2_Mod.pc_type = random 0 2

				Frag2_Mod.pc_numpoints = (FRAG_SIZE / New_Size)
				Frag2_Mod.seed = (Random 0 9999)
				addModifier Large_Frags[LF] Frag2_Mod
				T_Frags = RFMxs.explodeToElements Large_Frags[LF] deleteOriginal:true suffix:("GlowFrag_")
				for f = 1 to T_Frags.count do(
					T_Frags[f].wirecolor = (color (random 0 255) (random 0 255) (random 0 255))
				)
			)
			progressUpdate 50
			
		)
		All_Frags = $GlowFrag* as array
		if Bake_It == True do(
			for BB = 1 to All_Frags.count do(
				select All_Frags[BB]
				Rig_Mod.meshCustomMesh = All_Frags[BB]
				Rig_Mod.meshType = 6
				addModifier All_Frags[BB] Rig_Mod
			)
		)
		clearSelection()
		free Large_Frags
		free Size_Array
		free Size_Short
		completedraw()
		progressUpdate 99
		progressEnd()
		gc()
	)
)
 
  08 August 2015
on the subject of slicing, what method do we think the Slice modifier uses on editable mesh in operate on polygon mode ?

it's not MeshDelta::Slice or MeshDelta::Cut (works the same only if quads). Would be the one modifier you'd like to be in the samples that's not . So it's probably something proprietary :( And why the polygon option is not made available to the editable mesh & modifier
 
  08 August 2015
Originally Posted by Klvnk: on the subject of slicing, what method do we think the Slice modifier uses on editable mesh in operate on polygon mode ?

it's not MeshDelta::Slice or MeshDelta::Cut (works the same only if quads). Would be the one modifier you'd like to be in the samples that's not . So it's probably something proprietary :( And why the polygon option is not made available to the editable mesh & modifier
Haven’t tried it, but couldn't it be MNMesh::Slice?

The Slice modifier changes the object class according to the used method to PolyMeshObject or Editable_mesh.
__________________
Jorge Rodríguez
PolyTools3D
 
  08 August 2015
so it does, thanks pt3d, not so proprietary after all

there's an example of how to pass a PolyObject down the pipeline in tessmod.cpp BTW

Last edited by Klvnk : 08 August 2015 at 07:09 PM.
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:30 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.