Qbound Posted December 18, 2009 Share Posted December 18, 2009 Hi all, are the decals working in 2.3? i tried to create a decal but i got a NULL pointer back. And i think i setup the parameters right. hopefully here is the code // Create the pick TPick _Pick; // get the ground of the mesh LinePick( &_Pick, m_vPositionCurrent, Vec3( m_vPositionCurrent.X, m_vPositionCurrent.Y -10, m_vPositionCurrent.Z ),0 ,1 ); // Create the ground decal m_MeshDecal = CreateDecal( _Pick.surface, m_vPositionCurrent, 2, 32 ); m_matDecal = LoadMaterial( "abstract::SFX_DECAL_WAKE.mat" ); PaintEntity( m_MeshDecal, m_matDecal ); m_vPositionCurrent is the current position of the player and it is set correct. It has an offset of 2 and the linepick gave me a surface back. I do not understand what the parameter at the end of the createdecal is. so far with searching the forum (old one) most used 32 a change of this parameter has no effect at all. cu Oliver Quote Windows Vista 64 / Win7 64 | 12GB DDR3 1600 | I7 965 | 2 * 280GTX sli | 2 * 300GB Raptor | 2 * 1.5TB Link to comment Share on other sites More sharing options...
Masterxilo Posted December 18, 2009 Share Posted December 18, 2009 They haven't worked since some versions ago... Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
Marleys Ghost Posted December 18, 2009 Share Posted December 18, 2009 They haven't worked since some versions ago... I've not tried since 2.27 and finding they did not work, but hasn't Tyler got decals working (or something similar) in his weaponwerks project? Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Masterxilo Posted December 18, 2009 Share Posted December 18, 2009 Hmm, ok, maybe they were fixed, or everyone who tried before did something wrong. Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
TylerH Posted December 19, 2009 Share Posted December 19, 2009 Yes, I do have decals working. Here is my code to create a decal: if (pick.surface~=nil) then SetWorld(fw.transparency.world) decal = CreateDecal(pick.surface,TFormPoint(pick.position,nil,pick.entity),1.0/16.0,64) SetWorld(fw.main.world) if (decal~=nil) then decal:SetParent(pick.entity,0) --decal:Paint(LoadMaterial("abstract::bullethole.mat")) decal:Paint(GetImpactDecal(GetMeshModel(pick.entity))) decal:SetColorf(1.0,1.0,1.0,bullet.damage/bullet.initialdamage) end end You can ignore the SetColorf and GetImpactDecal stuff, those are things for Weaponwerks for the dynamic impact system, and to set the alpha of the decal based on how much damage the bullet has inflicted relative how much it could in perfect conditions. For CreateDecal from a pick, you need to pass the surface, the transformed pick position from world to entity space, the radius (1/16.0 is what Josh used by default and makes a nice, though slightly too big bullet hole), and 64 is the max tris (the higher this is, the better the decal can align to the surface). The transparency world and decal:SetParent calls are key in order to make sure it is visible and sticks to the surface. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Qbound Posted December 19, 2009 Author Share Posted December 19, 2009 Thanks for the help. Ill try this out. At the moment i think the problem is that i do not hit a surface and there for there is no decal created. btw. why you don't use 0.0625 as the 3rd parameter. it will be faster then everytime a devision. cu Oliver Quote Windows Vista 64 / Win7 64 | 12GB DDR3 1600 | I7 965 | 2 * 280GTX sli | 2 * 300GB Raptor | 2 * 1.5TB Link to comment Share on other sites More sharing options...
Marleys Ghost Posted December 19, 2009 Share Posted December 19, 2009 Hmm, ok, maybe they were fixed, or everyone who tried before did something wrong. I never got them working in 2.24 to 2.27 I then gave up, but I noticed them working in one of Tylers vids where he is going "Postal" on some lockers. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
macklebee Posted December 19, 2009 Share Posted December 19, 2009 Tyler, how are you preventing the old problem of the shot object from changing colors or getting streaks on it? what does your material file look like for the decal? Quote 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 More sharing options...
TylerH Posted December 20, 2009 Share Posted December 20, 2009 The material file was a straight up copy from the last version of the SDK that had shot1.mat or whatever. I think 2.25. Here is the material file: texture0="abstract::shot1.dds" shader="abstract::mesh_diffuse.vert","abstract::mesh_diffuse_alphatest.frag" alphatest=1 blend=mod2x depthmask=0 //normalmask=0 overlay=1 clamp0=1,1 castshadows=0 Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
macklebee Posted December 20, 2009 Share Posted December 20, 2009 hmmm... thats exactly what I was using.. I get the cross pattern around the decal that discolors the entire shot object's face. This was an old problem that occurred back in the early 2.2X days as well for me. Quote 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 More sharing options...
TylerH Posted December 20, 2009 Share Posted December 20, 2009 Are you creating the decal in the transparency world? Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
macklebee Posted December 20, 2009 Share Posted December 20, 2009 this is what I am referring to as a cross pattern on the model that is shot... Quote 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 More sharing options...
TylerH Posted December 20, 2009 Share Posted December 20, 2009 That is strange, because I don't get that at all. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
macklebee Posted December 20, 2009 Share Posted December 20, 2009 That is strange, because I don't get that at all. Ive always had this problem... and I remember others posting about this on the old forum but I can't seem to find those posts... yep, I am creating the decal in the transparency world... using your code! B) Quote 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 More sharing options...
TylerH Posted December 20, 2009 Share Posted December 20, 2009 Hmm. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
macklebee Posted December 20, 2009 Share Posted December 20, 2009 ok... ?? i just closed down the editor and restarted it... now it works fine? what in the world? Quote 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 More sharing options...
TylerH Posted December 20, 2009 Share Posted December 20, 2009 B) Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
macklebee Posted December 20, 2009 Share Posted December 20, 2009 yeah... i dunno. changed absolutely nothing inbetween taking that screenshot and restarting the editor... B) Quote 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 More sharing options...
Canardia Posted December 20, 2009 Share Posted December 20, 2009 Many things in Editor stop randomly working from time to time. Then you can close all programs and suddenly they work again. Just had emitters stop working on firepit and a new emitter, but on one scene they worked, it's totally wierd B) I blame programming languages with garbage collection (like BlitzMax), as they allow the programmer to make randomly working code, since they don't crash each time when the programmer makes a mistake, and that's bad. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Masterxilo Posted December 21, 2009 Share Posted December 21, 2009 Agreed. Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
Qbound Posted December 22, 2009 Author Share Posted December 22, 2009 i second that... cu Oliver Quote Windows Vista 64 / Win7 64 | 12GB DDR3 1600 | I7 965 | 2 * 280GTX sli | 2 * 300GB Raptor | 2 * 1.5TB Link to comment Share on other sites More sharing options...
Chiblue Posted February 17, 2010 Share Posted February 17, 2010 When using decals and Gamelib, I don't seem to be able to get the decal to show, any thoughts? if (pick.surface != NULL) { SetWorld( scene->framewerk.transparency.world); TMesh decal = CreateDecal(pick.surface,TFormPoint(Vec3(pick.X,pick.Y,pick.Z),NULL,pick.entity),10.0,64); SetWorld( world ); if(decal != NULL) { EntityParent(decal,pick.entity,0); PaintEntity(decal,LoadMaterial("abstract::bullethole1.mat")); EntityColor(decal,Vec4(1.0,1.0,1.0,1.0)); } } SetWorld( world ); Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
TylerH Posted February 17, 2010 Share Posted February 17, 2010 I think you need to have the position non-transformed first, I had to experiment with variations of the position code in my particular implementation because I modify entity positions and undo them, hence all the transforms I have. I would try just placing the decal at 0,0,0 on an entity, then try 0,0,0 transformed between various spaces. Hope that helps! Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Chiblue Posted February 17, 2010 Share Posted February 17, 2010 I would try just placing the decal at 0,0,0 on an entity, then try 0,0,0 transformed between various spaces. Hope that helps! Yes it does, after reading this thread and then having a problem I wasn't sure if my code was correct... but I suspected that position may have been the case, when doing this in GDK, I used to start my decal as a box, position is on the object and then see were it was positions, but they did not have a special DECAL class, you had to use a plane.... Anyway thats for the suggestions.. Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Recommended Posts
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.