nSprite 1.0.0 Released!

Community Forums/Showcase/nSprite 1.0.0 Released!

gosse(Posted 2004) [#1]
The hottest 2D in 3D sprite library is here!


nSprite is a big set of functions to create 2D graphics using the capability and advantages of 3D cards. It also includes a few custom systems (collisions, animation, lighting, etc) that make the life even easier. The command set is really similar to Blitz2D, making an easy syntax to learn and enabling easy conversion from 2D to 2D in 3D. It can be used anywhere, from making an entire 2D game or to enhance 3D graphics with such thing as HUDs.

BlitzCoder Showcase:
http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=gosse04242004182653&comments=no


ErikT(Posted 2004) [#2]
I've been roaming the docs and it looks real nice, thanks! Sucks that I don't have Blitz3D (yet) :/

Is it possible, or even necessary, to include support for loading into system memory? I got plenty sprite images to load that would fill up the memory of older cards.


Perturbatio(Posted 2004) [#3]
.


R0B0T0(Posted 2004) [#4]
Great stuff, thanks for sharing your code!

Some issues I noticed right away:
-you misnamed nS_ClearEmitters() as nS_ClearEmitter()in Function nS_ClearAll()
-in the hud overlay demo I'm getting the overlay on a plain beige screen (not like the screenshot), although if i move the mouse around i get some weird zoomed geometry or something


gosse(Posted 2004) [#5]
@ Erik Thon:
Get it, quick! :P
Hrmm, dunno about that, because it uses Blitz images and textures.

@ Perturbatio :
Eh?

@ R0B0T0:
Doh, silly me, I noticed that I called the function nS_ClearEmitter when I was doing the docs, so changed it, but forgot to verify I didn't call it anywhere. Thanks for pointing it out.
Hmm, works really good here and for the few people I asked to try. Are you able to do some dual rendering without problems?


R0B0T0(Posted 2004) [#6]
GoSsE,

What do you mean by dual rendering? Using 2 cameras? Generally, I don't have blitz rendering issues with my setup (Geforce 4 4200) unless others are experiencing the same problems.


ErikT(Posted 2004) [#7]
I get the same thing here. All beige emptiness, except the HUD. My card's a Geforce2.


Dragon57(Posted 2004) [#8]
I get the beige emptiness as well. Specs in my sig.


Perturbatio(Posted 2004) [#9]

@ Perturbatio :
Eh?



I made a cock-up and thought your demo wasn't working, but it was.


slenkar(Posted 2004) [#10]
ja I get the biege screen as well, if it works it will be an awesome HUD


gosse(Posted 2004) [#11]
Well hrmm I don't know what to say.
I'll have to work out some test file with 2 cameras with the same settings.
Maybe its the ortho projection that's screwing it up. I hope not.

And its the demo I've spent the most time with!
Anyone has it working on their set-up besides me?


Rob(Posted 2004) [#12]
I get some sort of beige screen for the shooting demo, but it all seems really good.


PaulJG(Posted 2004) [#13]
Excellant Stuff !, couldnt have come at a better time !!.

Just finishing my 2d Tile editor, with this I can port it over to 3d.

Couple of questions for you:

1) Is this a single surface system ?
(gonna have ALOT of tiles/sprites flying around)

2) Can you still use 3d mode ?
(by that I mean.. could I still add things like 3d objects to the scene, or does this system fix the viewport and buffers in place.)

Ideally I'd love to have the best of both worlds.. a nice 2d/3d easy tile system, but still be able to have 3d objects mixed in. (such as 3d spinning powerups)

Even if its not possible - Thanks Again ! :)

Bit of feedback for you:

I get the same blank image for the shooty bit, but the bullets and gun aim are all present and correct.

The lighting demo really slows down to a crawl. (12 fps)


Murilo(Posted 2004) [#14]
>I get some sort of beige screen for the shooting demo, but it all seems really good.

Same here. I'm impressed with everything else I saw though. If this proves to be fast enough, I could be tempted to port some of my existing routines to utilise nSprite.

>The lighting demo really slows down to a crawl. (12 fps)

Yeah - It slowed to around 25 fps for me.


gosse(Posted 2004) [#15]
PaulJG:
When you duplicate a sprite, it uses the same surface. But if you reload it, it creates a new one.
Yes you can, but for some weird reason it comes out screwed up on 90% of the machines at the moment, but its all good and working on mine so I can't really iron it out. I'll be trying to create some test files with various things changed.

As for the lighting demo, could it be due to the Text commands? I know it slows to a hog on some machines when you use Blitz text commands.

Hmm just noticed something in some of the sigs. You seem to all have DX 9.0b and I've just checked and got DX 9.0... Maybe that's the problem. I'll be updating and checking.


Isaac P(Posted 2004) [#16]
It appears that the camera is parented to the end of the gun and when you rotate the the camera it only rotates it around this point at the end of the gun


PaulJG(Posted 2004) [#17]
@GoSeE:
I've only got 9.0 installed, so its not that...

When you say 'duplicate', do you mean displaying/drawing the same sprite twice or more on the screen ?.

Also tried adding a basic spinning cube to the demo, just couldnt see it. (perhaps due to the scaling factor you've got the screen setup as ?) - Could you please post up some code to show me how its done.


jfk EO-11110(Posted 2004) [#18]
the beige thing might be a result of a diffrent z-buffer resolution, i mean a rounding error due to a diffrent number of bits for the distance, that will affect the interpretation of the camera near range. Maybe it works with 32 Bits, but not with 24? Then again, this might be rubbish.


gosse(Posted 2004) [#19]
Well, it wasn't a DirectX version issue (got 9.0b now).

PaulJG: Yes, drawing the same sprite over and over; they share the same surface.
To have another render (like the FPS or a spinning cube), you have to put another camera to render before the nSprite one (creating it before calling nS_Initialize). Then you use this camera. If you wanted to place a 3D mesh according to 2D coordinates, they are planned for the next update, which should come within a week or so.

jfk: Nice hypothesis.. but.. it's hard to iron out when you don't see it happening on your PC. I'll try various screen modes.

|EDIT|
Nice one jfk. My desktop is set in 16-bit and it works perfectly. I changed the demo to full-screen and tried various mode; when I hit 32-bit I got the beige weirdness. I changed my desktop to 32-bit and I also got it. It works perfectly good in 16-bit tho :(
So, you were right on, it's some weird resolution bug. I'll try to see what I can do, but if you want to check the demo with the FPS, simply go in the nSprite_Demo.bb file and change the graphics line to:
Graphics3D 640, 480, 16, 1
And voila!
|END EDIT|

|MORE EDIT|
I found out that its because the camera is in the way of other 3D objects, and since its an orthogonal projection camera, they are of the real scale. All we see is the wall texture, but extremely scaled since the camera is scaled down. So by moving the camera at 0, -10000, 0, its no longer in the way and it works.
I really don't know why it only bugs in 32-bit mode tho. But, I'll fix it by moving the camera at this position. Expect new release soon ;)
|END MORE EDIT|


StOrM3(Posted 2004) [#20]
Okay, so if I am understanding this right, the game I already have which is 3D using a camera, in order to use this system, I need to put a 2nd camera in just for the 2d overlay stuff, bmp fonts etc.. and call the nS_init after that camera is created, so that should iron out the display probs I had, since now my level is not displayed correctly, the ground is on top of the objects, and no bmp fonts are displayed. I will try adding a 2nd camera just for nSprite tonight, and see if that fixes the problems..

This forum is very helpful, and this is an awesome lib btw: this is just what I needed right on time to do my bmp fonts for my game. You released it right as I was trying to add them myself. Thanks!


gosse(Posted 2004) [#21]
StOrM3:
No, you don't need a 2nd camera for nSprite; it will create it itself.
You first create your normal 3D game camera, then call nS_init. The bug you are experiencing is being fixed. Just try this: PositionEntity nS_CamHUD, 0, -1000, 0 just after calling nS_Init to see if it works.
Its just that sometimes, when no 3D camera are present besides the nSprite one, it *can* causes problem.
And, thanks ;)


electronin(Posted 2004) [#22]
Way cool, GoSsE! I like the animated sprites, very handy :)
what is the DLL for?


gosse(Posted 2004) [#23]
nSprite 1.1.0 released!
http://www.nuloen.com/nSprite.zip

What's new:
-Removed the .DLL file as only the .DECLS does the job
-Fixed a typing error in the particle system
-Fixed a bug happening in 32-bit mode with 2D over 3D graphics
-There is now functionality for entity blending (nS_ImageBlend & nS_GetImageBlend)
-Updated the Graphical Intensive Demo a bit
-Added nS_GetEntityHandle to get the handle of the sprite’s entity
-Functionality for 3D objects have been added (3D objects positioned with 2D coordinates and such – see demo for example) (nS_Create3DObject, etc.)

electronin: Thanks a lot! The DLL was for the .DECLS to work but someone pointed out to me that (and how) you could do without it and have now removed it.

Now all of you that could only see the beige screen, its time to see the light ( I hope :P :D )!


R0B0T0(Posted 2004) [#24]
Works perfectly now. Thanks again!


ckob(Posted 2004) [#25]
better then before :) love the work and as always love the open source bit


PaulJG(Posted 2004) [#26]
Lovely ! :)

All present and correct.. and thanks for the 'nS_Create3DObject' command ! ;)


StOrM3(Posted 2004) [#27]
okay.. Now my fonts display fine on screen, only one prob, I had to use the nS_Cls(false) to get the correct zorder for my text to display over top of my game correctly. Also, one other question, this thing has slowed down my 3D Game Play Tremendously... so I am thinking about converting my images over to 2d sprites for use with this lib, my question is this though, I want to use PNG format, and I need to know what color is transparent in PNG format, so if I change all my items over, I want to be able to overlay items over top of other things, and still have the things below show through.

I'm sorry if I made this hard to understand, but what I want to know is, will nSprite use PNG format files, and how do I make like the background portions transparent.. is it Black color 0,0,0 or is it the magic pink, 255,255,0 or what ? BTW: Thanks again for this awesome lib. Maybe I can stay with 3D Objects if I just use your new Create3D Objects and stuff, I think my slowdown is attributed to the fact that I am running it on a 16meg ati card, do you use vram for your sprites ? Instead of system memory ? If so, I may need to try running it on my powerful server system with the FX5200 256mb card and see if I experience the same slow movement or not. Also it seems like it gets slower over time also now, on my portable that is.

Just an FYI and alot of questions, sorry, but I need to do alot of code porting, and wondering best way to go about it.


jfk EO-11110(Posted 2004) [#28]
Thanks for sharing! Finally very useful for perfectly antialiased 2D Games, lightning fast translucent 2D GFX as well as HUD stuff.


gosse(Posted 2004) [#29]
StOrM3:
Yeah, you must use nS_Cls since it repositions everything correctly. That is if you draw everything each frame. However, if you don't change what's on screen very often, you can only display it once and it will stay there.

With all formats (its a 3D spec), black (0,0,0) is transparent in textures. You can also use my nS_MaskImage command (which is slow) to have another transparent color, but black will always remain transparent.
But with PNG and TGA you can also have an alpha channel for opacity, but you have to load the sprite as a power of 2. If the image is not a power of 2, it will be distorted. So you have to load it with nS_LoadImage(file$, 2 (alpha), True (power of 2)).

Textures are loaded by default, which I think is system memory (maybe some knows more about this?).

For the slow down, I don't know, it shouldn't as nothing is done (created, etc) each frame. But maybe you get a slow down in the FPS demo over time since it creates new bullet holes and never clear the old ones.

And, thanks :D

jfk:
Thanks a lot!


StOrM3(Posted 2004) [#30]
BTW: when I convert this to using 2D images, how slow is your PP Collision routines ? As I will be testing 37 images. 6x6 rows of items, against a player object also.

Maybe more since I will have to enclose the screen in with objects to bounce off of. So say 41 objects.


gosse(Posted 2004) [#31]
This is Blitz' Pixel Perfect Collision routines, so its as fast as Blitz since it is Blitz :P
I might recommend my custom collision system tho, depending of what the objects are.


StOrM3(Posted 2004) [#32]
don't know why just using nSprite for bmp fonts would slow it down like that then... Hmmm anyways going to convert over to using nSprite for everything, and see if I can get it back up to speed again. It was running fine full speed movement for player, shooting and everything, then I added the bmp fonts using nSprite, and now over time it starts slowing stuff down, and sometimes misses an input on the mouse button press, also, there is a mem leak somewhere, because it only gradually start slowing down, then when I try to exit using ESC, it doesn't exit sometimes, winblows just says not responding in the title bar.

Anyways I am just trying to help, if there is some leak somewhere, all I am using is the initialize, cls, createstring, ns_text functions. In the gamesetup which is called everytime you change levels I call ns_freeall() first, then do the camera, and setup ns_init then in my showinfo function, called every cycle through game loop, I do a createstring to build the timer string, and ns_text to display it. That is the only thing different.

Any ideas ?


gosse(Posted 2004) [#33]
Do you destroy the timer string once you used it?

If you don't mind, you could e-mail this so I can debug and see what's going wrong.


StOrM3(Posted 2004) [#34]
okay, yea, when I get home I will email it to you, just send me a test email with your email in it, send it to storm3@... so I can just reply to it when I get home and I will include the source for you too look at, the zip is 3 megs.. I will include just the source, media, and comment out the soundfx and stuff., should be much smaller.


Dragon57(Posted 2004) [#35]
Works great now, thanks!


Murilo(Posted 2004) [#36]
>This is Blitz' Pixel Perfect Collision routines, so its as fast as Blitz since it is Blitz :P

Sorry if this is a stupid question, but what about when sprites have been scaled/rotated?


ErikT(Posted 2004) [#37]
I think that's what the custom collision system is for :)


gosse(Posted 2004) [#38]
Daze:
Well, you can update the PPC when you scale and rotate, but it is slow. But, as Erik Thon mentionned, this is why I built a custom collision system.


StOrM3(Posted 2004) [#39]
Don't know if you got my other email this morning yet or not GoSsE, but the nS_FreeAll() has a problem with the fonts too. Because after each level you clear it goes back to gamesetup and calls the nS_FreeAll() so the font objects etc.. can be reloaded, and I added your function and it worked great until I changed levels then got the memory access violation again, I am assuming from using the nS_FreeAll() since it does not free the string handles properly or something.

Although I am still considering converting to using nSprite totally for everything, including using your collision system, mainly because I want to add some neato affects like your particle system, and explosions and the items rotating when you hit them etc.. I will have to read the docs more thoroughly so I understand how to load and setup the collision system with my objects.

I may also either convert to 2d all the way to make the special fx easier to code, or use your create3dobjects function, and do it that way, so I can use your collision code etc.. on the objects.

Give me your honest opinion which way do you think would be the easiest to add special fx to it ?


ErikT(Posted 2004) [#40]
It just struck me; there seems to be no FlipImage() function. Since it's all using 3D there should be no prob having one. C'mon, whaddya say :D


poopla(Posted 2004) [#41]
ResizeImage()? :) Or did I miss it? I love this lib :).


ErikT(Posted 2004) [#42]
I don't have B3D so I can't check it :P


gosse(Posted 2004) [#43]
Erik Thon:
Sounds like a nice idea! Maybe it works using negative scale tho. I'll give it a try and maybe add it for the next release.

ShatteredReality:
Nope, I'm the one that missed it, it will be in next release. Thanks!

Next release should be in a week or 2. There still is some string freeing bugs in there and I want to add some other features.


elseano(Posted 2004) [#44]
Wow, great! I am currently converting my would-be 2d only game to use nSprites brilliant features. It's not really that difficult to change a 2d game to use nSrptie...


slenkar(Posted 2004) [#45]
how do you change a string in-game without it going very slow??

I only change 1 string every second for my frames-per-second display and the game goes 4 times slower than before!


StOrM3(Posted 2004) [#46]
You must use the nS_FreeString() function, that is not included in the current release, I can shoot you a copy of the function if you need it. What is happening is the strings, are eating up your memory, and your never freeing them. I have it, though, so I will post it tonight for everyone to snag. The only issue I currently have with the nSprite lib, while patiently awaiting next release is the nS_FreeAll function will not work properly when using fonts. It throws a memory violation error. So, the only downside, is having to manually free items, using the other included functions, and by using the nS_FreeString function he emailed me.

But yes, this library is awesome, I have added it to my website, credits, and everything, but I am just wondering when the new version will be out ? He mentioned releasing a new update, in a week or two, but have heard nothing...

GoSsE you still alive ?


slenkar(Posted 2004) [#47]
ok Ill download it when you post it,
I wouldnt have thought that was the problem because Im only creating a new string each second and the game goes slow from the beggining, but Ill try it and see what happens.

When I use SmPro for text its just as fast as the text function in blitz, is N_Sprite's text the same with the freestring function?


gosse(Posted 2004) [#48]
Hehe wow, I missed quite a few posts here :D

Yes I am still alive, thanks for all the nice comments.

I am working on the next release, I might break it in 2 since I want to do a lot of stuff for it.

Here's the freestring function in question:
[CODE]
Function nS_FreeString(hString)
Local oString.nS_String = Object.nS_String(hString)
For i = 1 To oString\iLength
nS_HalfFreeImage oString\sprChars[i]
Next
Delete oString
End Function
[/CODE]

But yeah, if you use FreeAll with fonts, it will break ;)

I'll try to send a small release with better text handling within the next week, but I'm not sure about that.

You can also head over to my forums for discussing about nSprite:
http://gosse.proboards19.com/


PantsOn(Posted 2004) [#49]
GoSsE - very impressed with the lib.
heres a function that I wrote that could/should be included..
; ----------------------------------------------------------------------

; PAINTS SPECIFIED VERTEX OF SPRITE
; use the below consts for vertexIDs
Const nS_BottomLeft = 0
Const nS_TopLeft = 1
Const nS_TopRight = 2
Const nS_BottomRight = 3

Function nS_PaintVertex(image, vertexID, ir, ig, ib, alpha#)
	sprite.nS_Sprite = Object.nS_Sprite(Image)
	VertexColor GetSurface(sprite\sprImage,1),vertexID,ir,ig,ib,alpha
End Function


to use PaintVertex you need
nS_ImageFX image,3


keep up the good work...


Red(Posted 2004) [#50]
- Bug fixed : black color keep transparent after maskimage
- Improve Ns_Cls : 100 -> 10000 (my sprite size is over 100)

New Version of Ns_MaskImage
----------------------------
; Changes the mask of an image
Function nS_MaskImage(Image, Red, Green, Blue)
	Local i, x, y, size, c, r, g, b, m
	sprite.nS_Sprite = Object.nS_Sprite(Image)
	size = sprite\size
	For i = 0 To sprite\TotalFrames - 1
		SetBuffer TextureBuffer(sprite\texSprite, i)
		LockBuffer
		For x = 0 To size - 1
			For y = 0 To size - 1
				If x < sprite\Width And y < sprite\Height Then
					c = ReadPixel(x, y, ImageBuffer(sprite\imgBase, i))
					r = (c Shr 16) And $000000FF
					g = (c Shr 8) And $000000FF
					b = (c ) And $000000FF

					; It is the new mask
					If r = Red And g = Green And b = Blue Then
						WritePixelFast x, y, 0					
					; It is the old mask
					ElseIf r = sprite\maskRed And g = sprite\maskGreen And b = sprite\maskBlue Then						
						WritePixelFast x, y, c
					End If
				End If
			Next
		Next
		UnlockBuffer
	Next
	sprite\maskRed = Red
	sprite\maskGreen = Green
	sprite\maskBlue = Blue
	MaskImage sprite\imgBase, Red, Green, Blue
	SetBuffer BackBuffer()
End Function


New Version of Ns_Cls
----------------------------
; Clears the Z-Buffer and moves all sprites away from view
Function nS_Cls(bClearScreen = True)
	If bClearScreen Then
		Cls
	End If
	nS_Z# = 0
	For sprite.nS_Sprite = Each nS_Sprite
		PositionEntity sprite\sprImage, -10000, -10000,-10000
	Next
	nS_DrawImage nS_sprBlank, 0, 0
End Function



gosse(Posted 2004) [#51]
hehe great job guys!
I'll make those changes for the next release!
And don't hesitate to post on my forums :D

I'm about halfway done for the next release and already have lots of stuff queued for another release after that. ;)

I'm glad you guys like the lib I did!

Also, on my forum I created a thread for games using nSprite, you can post screenshots or links there if you've got something to show! There's already a full game that have been done with nSprite; pretty impressive!


Red(Posted 2004) [#52]
I would easier to code if Zorder is saved.

Ns_LoadImage player
Ns_ImageOrder player

Ns_LoadImage rocket
Ns_ImageOrder rocket


...and to change Zorder:

Ns_UseImageOrder Z

Ns_DrawImage rocket,.... 
Ns_DrawImage rocket2,.... 
Ns_DrawImage player,....,Zplayer -> use specific value
Ns_DrawImage particle,.... 



gosse(Posted 2004) [#53]
New version up in a few hours, but shhhh don't tell everyone... ;)


Red(Posted 2004) [#54]
:) Can't wait


gosse(Posted 2004) [#55]
There it is!
Quite a new version there!
No new demos this time tho, maybe next time!

1.2.0 (10/05/2004)
-Functions that have changed (in the way they work or the parameters taken): nS_ScaleImage, nS_CreateImage, nS_CreateFont, nS_FreeAll.
-nS_ScaleImage have been changed so it now works exactly like Blitz’ ScaleImage function.
-You can now specify the number of frames when you use nS_CreateImage.
-nS_CreateFont has been modified so you can enter a range of ASCII character to generate (32 to 127 has most standard characters).
-nS_FreeAll now truly frees everything from memory. No more problems should arise from it.
-New functions: nS_ResizeImage(), nS_FreeRotateImage(), nS_PaintVertex(), nS_FreeString(), nS_ChangeString(), nS_FreeFont(), nS_ClearWorld().
-Blitz’ ResizeImage has been integrated (as nS_ResizeImage) and can also work with percentage instead of pixels.
-You can specify an angle and free rotate it to that angle with nS_FreeRotateImage.
-You can paint one of the 4 vertices (vertex color + alpha) with the new nS_PaintVertex function.
-You can finally free strings and fonts that you create with nS_FreeString and nS_FreeFont.
-You can change the content of a string with nS_ChangeString
-If you call ClearWorld and want to delete every nSprite entities, simply call nS_ClearWorld.
-Each time nSprite draws an image, it increments nS_SpriteCount, so you can access (for debug purposes) to know how many sprites are drawn.
-Bug fixes:
-Sorted some image handles problem (with scaling, rotating, changing handles), they are now 100% accurate.
-Fixed RGB conversion codes bug (this fixed some mask image issues).
-Moved the cleared sprites farther away (so they don’t get in view).
-Changed how fonts are saved and loaded (backward compatible).
-nS_CreateString & nS_ChangeString traps errors if you try to load a character not in the font set.
-Fixed a Z-Order bug that caused 2 images to be on the same Z-Order.


Red(Posted 2004) [#56]
Bug in maskimage
----------------
If x < sprite\Width Or y < sprite\Height Then


Replace 'OR' by 'AND'
If x < sprite\Width And y < sprite\Height Then



Red(Posted 2004) [#57]
In the demo, I didn't see any logo.
But there's 33 sprites

Perhaps it's a bug in Ns_DuplicateImage: two lines missed
newsprite\fmeshX = sprite\fmeshX
newsprite\fmeshY = sprite\fmeshY



gosse(Posted 2004) [#58]
Wow.

I was sleepy when I posted this version. I didn't even check it properly. I'll try to do a quick fix version today or tomorrow.


Red(Posted 2004) [#59]
- Ok didn't found any more bug.There's only two.

- I'm trying to code a editor for nSprite

nSprite Collision Editor
-------------------------
nSCE




gosse(Posted 2004) [#60]
Version 1.2.1 released!

1.2.1 (16/05/2004)
-Fixed a small bug within nS_MaskImage with non-square image
-Fixed a small bug for image copies/duplicates (missing variables)
-Fixed a bunch of stuff with the Z-Order (mainly float problems)
-Fixed small glitches in the demos (display errors)
-Repaired animation modes (animations were not timed correctly)


Red(Posted 2004) [#61]
It works perfectly


StOrM3(Posted 2004) [#62]
Hello again, been awhile, been pondering how to pull this off in my engine. The conversion that is, I have about get everything figured out, one final problem.. All My models already have the textures applied, and there are mulitple textures, like each group from milkshape3d has a texture applied, most the time, unique.. I export my models as either .b3d or .x files, then paint in Tattoo, for final touch ups, then re-save, and load the models into blitz, already textured.

My problem is your nS_Create3DObject requires a texture handle to use... for texturing the object, now is this the texture that nSprite uses to initially texture the object or will it use the built in textures, built into the models, and this is merely a handle for my use later if I want to modify the texture on the model ? If I have to have the texture handle up front, it is going to make it very difficult to load all my models in a loop as they all have different amount of groups, and different amounts of textures, and all have different texture filenames.

Please help me figure this out, as my models don't all have 1 texture applied to the whole model, as alot of other people do, I do this because when you paint an object in Tattoo, with multiple groups, but sharing the same texture, what you paint on one surface gets mirrored to the other surfaces.

If need be, I guess before I export it, I could regroup them all into one group, and put some generic one texture on the model, then paint it in tattoo that way, which would be very difficult..

Then resave the model / texture, then load in nS_ functions, but even then, how do I get the texture handle applied to the model so I can pass this to the nS_ function for creating 3D Objects ?

I hope you understand what i'm saying..

Thanks for any and all help.. it is greatly appreciated in this late stage of the game dev. cycle.

Ken aka StOrM3


aCiD2(Posted 2004) [#63]
Why not use the GetSurfaceTexture function, i think there's that function? or you could do GetBrushTexture(GetSurface(ent, 1)) ? Not sure, speaking from mem here, check the b3d docs