SgDecalProjector != distance fog
by Caylo Gypsyblood · in Torque Game Engine · 11/26/2006 (5:11 am) · 31 replies
#2
11/29/2006 (11:01 am)
Torque's decals are not affected by fog. There's no easy way enable this other than changing the rendering code.
#3
But then I can not find ''getRenderTransform': identifier not found' how to fix this. It may not be obvious, i can read the code well and comprehend what i see, but i have never truly written anything.
11/29/2006 (2:24 pm)
I want to change the rendering code! I have examined and learned what it is in tsStatic.cc that calculate the fog:Point3F cameraOffset;
getRenderTransform().getColumn(3,&cameraOffset);
cameraOffset -= state->getCameraPosition();
F32 dist = cameraOffset.len();
if (dist < 0.01)
dist = 0.01;
F32 fogAmount = state->getHazeAndFog(dist,cameraOffset.z);But then I can not find ''getRenderTransform': identifier not found' how to fix this. It may not be obvious, i can read the code well and comprehend what i see, but i have never truly written anything.
#4
12/02/2006 (8:54 pm)
I dont wanna seem rude, but I sit here and see 'tards' asking the same question over and over, (in different ways). But anytime i ask about something i get a sloppy reply and then nothing. Come on now! Do you think i would have asked this if I could work out the answer myself? Im sure someone that knows a bit more then me could take all of 4 minutes from there buzzy life and propose an solution. And John, i dont know what to say. I feared that when the 1.5 came out with your lighting code in it, that you would get lazy and not really CARE anymore, thanks for proving my fears right...
#5
Caylo - From someone who is most assuredly one of those 'tards', the simple fact is that John gave you the correct answer, but is not obligated to work it out for you. I have heard this so many times, "If you want it to do that, then try doing it yourself". I have found this philosophy has forced me to learn how to do things and I have even managed to come up with stuff not shown around here because of it. Sure it takes time and a lot of reading through code and learning to understand it, but in the end it is worth it.
Simply put Caylo these guys who offer the code are not obligated in anyway to help you modify it to suit your needs. The ones that do are just generous. Won't stop me from begging though, heheh.
John - It does sound like a neat future feature though.
12/02/2006 (10:18 pm)
*Looks around for the flying rocks*Caylo - From someone who is most assuredly one of those 'tards', the simple fact is that John gave you the correct answer, but is not obligated to work it out for you. I have heard this so many times, "If you want it to do that, then try doing it yourself". I have found this philosophy has forced me to learn how to do things and I have even managed to come up with stuff not shown around here because of it. Sure it takes time and a lot of reading through code and learning to understand it, but in the end it is worth it.
Simply put Caylo these guys who offer the code are not obligated in anyway to help you modify it to suit your needs. The ones that do are just generous. Won't stop me from begging though, heheh.
John - It does sound like a neat future feature though.
#6
But if you click my name, scroll down and find "has created" X threads, you will find that NONE of my few questions have truly been answered. I paid for the product and got what i expected. What i did not expect was compleate lack of support for the few things i ask for help on.
If you read over all the common questions people seem to ask, you might notice a forum thread of 2 pages about a topic as mundane as switching mesh skins. Heck, i try to go out of my way and help people who ask questions on the forums as much as i can, and i never got any money for anything these people are using from me. I just expected a bit more respect then John saying "There's no easy way enable this other than changing the rendering code" Come on! i already KNEW that. But a point in the right direction, some small bone for me to gnaw on. Heck i already know WHAT i need to do, i just can not figure out HOW. I invested many years on learning the game art creation side of game design, not programing- i only have a bit over a year worth of programing experiences.
I know there are people here that know allot about programing and my simple problem is nothing more then a gnat drowning in there wine.
12/02/2006 (10:44 pm)
Your right Ron. I never ment to sound like i was pleading for someone to solve my problems. But if you click my name, scroll down and find "has created" X threads, you will find that NONE of my few questions have truly been answered. I paid for the product and got what i expected. What i did not expect was compleate lack of support for the few things i ask for help on.
If you read over all the common questions people seem to ask, you might notice a forum thread of 2 pages about a topic as mundane as switching mesh skins. Heck, i try to go out of my way and help people who ask questions on the forums as much as i can, and i never got any money for anything these people are using from me. I just expected a bit more respect then John saying "There's no easy way enable this other than changing the rendering code" Come on! i already KNEW that. But a point in the right direction, some small bone for me to gnaw on. Heck i already know WHAT i need to do, i just can not figure out HOW. I invested many years on learning the game art creation side of game design, not programing- i only have a bit over a year worth of programing experiences.
I know there are people here that know allot about programing and my simple problem is nothing more then a gnat drowning in there wine.
#7
12/03/2006 (12:05 am)
I see, your frustration seems to be primarily with the Lighting Kit. Admittedly there is always room for improvement. But as you may have noticed, John is really only there in to do the big work when there is something wrong with his product and more of an advisor of a sort when it comes to modifying it. Truth is, he might not know.
#8
12/03/2006 (12:59 am)
Im not frustrated, im an existential. And Jonh has done a great job with the Lighting Kit. Heck the TLK is the only reason i decided on getting Torque. Without TLK Torque shows its age as a old fashion washed up 3D engine, the only thing keeping it from becoming CLASSIC is the fact its not build for the VOODOO hardware. Im happy to see they put TLK into 1.5 im not happy they decided to charge extra for 1.5 even if its only $25 for me- code wise there is not alot of appealing NEW features. But my project is nearly finished and i dont use 1.5, the 1.5 demo runs like shit on my computer. I dont know what they did to 1.5 to make it so crappy but im very happy with 1.4. Anyhow im running a 104 temperature and should not even type opinions at this stage without the regret of sounding like a jerk.
#9
I can give advice, but for complex changes my first response to a post is always to gauge the seriousness of the poster - 9 times out of 10 learning that the fix requires OpenGL coding is followed up with "never mind, it's not that important".
As for the long follow up, this happens occasionally when major projects are wrapping up (ie: crunch mode) - you'll notice my development blog hasn't been updated recently either.
The 1.5 demo runs slow because of the art assets in it, not the code - I find it amazing that so many people compare the 1.4 Stronghold demo to the 1.5 demo and complain about the frame rate difference.
Regarding your original question I don't understand what you need to know. If you know how to use OpenGL fog coord, and how to get the fog distance using getHazeAndFog, then you just need to pass in the value.
Regarding the render transform, you'll need to get the distance from the current scenegraph camera position and the decal position - the scenegraph info is passed into the decal manager render call (see SceneState::getCameraPosition()).
12/03/2006 (7:20 am)
TLK is still very much supported, however all of your threads are about trying to do things with the system that it doesn't support.I can give advice, but for complex changes my first response to a post is always to gauge the seriousness of the poster - 9 times out of 10 learning that the fix requires OpenGL coding is followed up with "never mind, it's not that important".
As for the long follow up, this happens occasionally when major projects are wrapping up (ie: crunch mode) - you'll notice my development blog hasn't been updated recently either.
The 1.5 demo runs slow because of the art assets in it, not the code - I find it amazing that so many people compare the 1.4 Stronghold demo to the 1.5 demo and complain about the frame rate difference.
Regarding your original question I don't understand what you need to know. If you know how to use OpenGL fog coord, and how to get the fog distance using getHazeAndFog, then you just need to pass in the value.
Regarding the render transform, you'll need to get the distance from the current scenegraph camera position and the decal position - the scenegraph info is passed into the decal manager render call (see SceneState::getCameraPosition()).
#10
Dont misunderstand me, as soon as im dont with the project im working on right now i will get 1.5 and take a look to see why it stutters and pause.
Is not most everything a person do with the Torque SDK "trying to do things with the system that it doesn't support" out of the box it hardy support a race game and an FPS.
And if you ask me decal projector is irresponsible, it do not follow the same rules almost everything else that is in the render pipe follow. It dont care about occlusion, skip the fog, heck it dont even take light into effect. Of course i started using them a LONG time ago before i even KNEW to notice that sort of thing. Now i have a large number of maps using the projectors in a wide range of ways, only to find the projectors are eating a LARGE section of performance. Now if i had known early on that projectors were so very simple and would eat the FPS right out of a games soul, I would have used more caution with them.
My point is how are "WE" supposed to know what, "all of your threads are about trying to do things with the system that it doesn't support.", parts of the system can do what? Its a bit diluted because SOME things can attach to OTHER things. SOME things CAN render IFL animated textures. And almost every render object in the game, FOG and occludes without "trying to do things with the system that it doesn't support"
And i guess just like everything else so far, i will end up working it out on my own.
12/03/2006 (10:47 am)
Im comparing the 1.5 "MY" level with a 1.4 "MY" level. Dont insult my intelligence assuming i would run an unfair test. Simply put 1.5 IS slower then 1.4. 1.5 stutters and pause. I use some FPS display code i found deep in the GG website to read the FPS and display it in a neat little GUI. I test using the exact same pref scripts. Dont misunderstand me, as soon as im dont with the project im working on right now i will get 1.5 and take a look to see why it stutters and pause.
Is not most everything a person do with the Torque SDK "trying to do things with the system that it doesn't support" out of the box it hardy support a race game and an FPS.
And if you ask me decal projector is irresponsible, it do not follow the same rules almost everything else that is in the render pipe follow. It dont care about occlusion, skip the fog, heck it dont even take light into effect. Of course i started using them a LONG time ago before i even KNEW to notice that sort of thing. Now i have a large number of maps using the projectors in a wide range of ways, only to find the projectors are eating a LARGE section of performance. Now if i had known early on that projectors were so very simple and would eat the FPS right out of a games soul, I would have used more caution with them.
My point is how are "WE" supposed to know what, "all of your threads are about trying to do things with the system that it doesn't support.", parts of the system can do what? Its a bit diluted because SOME things can attach to OTHER things. SOME things CAN render IFL animated textures. And almost every render object in the game, FOG and occludes without "trying to do things with the system that it doesn't support"
And i guess just like everything else so far, i will end up working it out on my own.
#11
The decal projectors interface Torque's existing decal system - if that decal implementation is insufficient you'll need to re-implement them. For most projects using Torque and for how the decal projects were designed to be used they are perfectly fine.
When working on extending features in ways no one has tried yet, you need to expect minimal feedback - I had similar experiences when first using Torque. You can't expect GG, SG, or anyone to customize the engine for you - I'll happily offer advice; for instance with mounting projectors, look at the light mounting code and port it to projectors. If you have further questions I'll try to answer those, but I can't do it all.
12/03/2006 (12:19 pm)
I think you need to calm down, no one is insulting your intelligence. I assumed because you stated:Quote:the 1.5 demo runs like shit on my computer
The decal projectors interface Torque's existing decal system - if that decal implementation is insufficient you'll need to re-implement them. For most projects using Torque and for how the decal projects were designed to be used they are perfectly fine.
When working on extending features in ways no one has tried yet, you need to expect minimal feedback - I had similar experiences when first using Torque. You can't expect GG, SG, or anyone to customize the engine for you - I'll happily offer advice; for instance with mounting projectors, look at the light mounting code and port it to projectors. If you have further questions I'll try to answer those, but I can't do it all.
#12
John, there is a chance I have insulted you by implying the projector was a hack together, this was not intended. I had no idea it was actually a part of the Torque's existing decal system, the fact that it have its own rendering code tossed me off that track.
About 1.5, as i stated it, "the 1.5 demo..." was to clarify the fact that i was basing my decision that "IT runs like shit on my computer", by the demo itself and that I do not HAVE the 1.5 SDK to run other test on. I did make some test missions for 1.5, using content from MY 1.4 project. And to be extra fair, i even used the demo build of 1.4TLK when comparing the same mission running in both EXE. And honestly the decision that 1.5 is behaving poorly is not based on FPS, because for some odd reason the FPS from 1.5 is pegged at ~62 FPS. I decided that 1.5 demo runs like shit on my computer from its odd stuttering and over all NOT running as smoothly as the 1.4TLK.
I expect, and im not even trying to claim this is anything more then an observation, 1.5 is doing something different with the way it read or write memory, and whatever this may be is not very optimal for the 3 computers here i use as test systems.
I do not think you need to take it as personal insults when people mention that 1.5 is a bit odd, and instead of jumping to assumptions defending the 1.5, why not truly look into it yourself? (it took me all of 25 minutes to run my tests...)
Anyhow, John, i truly respect your work, many parts of TLK are just pure genius. I dont respect your customer relations. If one spent as much time working on the hard questions asked, as one spent on the easy to answer questions, there would be fewer questions over all being asked, for all of it gets recoded in an easy to search history.
12/03/2006 (3:03 pm)
I do not need to calm down, I am already calm. I am sure we are all reasonably intelligent people. I just wonder if your reading comprehension skills are upto par. Not only have i mentioned a few times now, im NOT trying to get anyone to solve my problems, but I just had hope for some pointers. And you are right, you have been 33% helpful in the few exchanges we have had. John, there is a chance I have insulted you by implying the projector was a hack together, this was not intended. I had no idea it was actually a part of the Torque's existing decal system, the fact that it have its own rendering code tossed me off that track.
About 1.5, as i stated it, "the 1.5 demo..." was to clarify the fact that i was basing my decision that "IT runs like shit on my computer", by the demo itself and that I do not HAVE the 1.5 SDK to run other test on. I did make some test missions for 1.5, using content from MY 1.4 project. And to be extra fair, i even used the demo build of 1.4TLK when comparing the same mission running in both EXE. And honestly the decision that 1.5 is behaving poorly is not based on FPS, because for some odd reason the FPS from 1.5 is pegged at ~62 FPS. I decided that 1.5 demo runs like shit on my computer from its odd stuttering and over all NOT running as smoothly as the 1.4TLK.
I expect, and im not even trying to claim this is anything more then an observation, 1.5 is doing something different with the way it read or write memory, and whatever this may be is not very optimal for the 3 computers here i use as test systems.
I do not think you need to take it as personal insults when people mention that 1.5 is a bit odd, and instead of jumping to assumptions defending the 1.5, why not truly look into it yourself? (it took me all of 25 minutes to run my tests...)
Anyhow, John, i truly respect your work, many parts of TLK are just pure genius. I dont respect your customer relations. If one spent as much time working on the hard questions asked, as one spent on the easy to answer questions, there would be fewer questions over all being asked, for all of it gets recoded in an easy to search history.
#13
As for customer service, I haven't had much of a problem until today. In fact looking over your previous TLK posts, I say you haven't had a problem until today either.
Your comment that I only answer the "easy" questions really bothers me. It my seem that way when the questions are within the scope of the product - this means that I can say for certain what changes to make and how they affect other areas of the engine.
When questions fall outside of the scope of the product or areas I've looked into (like decal fog, ifls in gui components, attaching arbitrary objects together, ...) I can only point to areas to look into (which I've already done above regarding decal fog), nothing more, because I have no other info to give.
12/03/2006 (3:41 pm)
I'm not insulted by your experience with 1.5, I'm insulted by your tone in the last few posts.As for customer service, I haven't had much of a problem until today. In fact looking over your previous TLK posts, I say you haven't had a problem until today either.
Your comment that I only answer the "easy" questions really bothers me. It my seem that way when the questions are within the scope of the product - this means that I can say for certain what changes to make and how they affect other areas of the engine.
When questions fall outside of the scope of the product or areas I've looked into (like decal fog, ifls in gui components, attaching arbitrary objects together, ...) I can only point to areas to look into (which I've already done above regarding decal fog), nothing more, because I have no other info to give.
#14
12/03/2006 (4:07 pm)
Ok, thank you. Sorry about my tone. Never meant this to sound like any raving rant. I guess the mistake was on my part for assuming the programmer of said parts to the engine would actually know ABOUT what information i seek. Just go to show, assuming anything about anybody is always a dangerous thing.
#15
He is obligated, since we paid for it, to provide support for the product he sold with the way it was meant to perform. You can't expect him to have to walk you through the process of creating what you want, he offered you advice, and that is going beyond the scope of any obligations he had to you in terms of support for his product.
Hell obligated might even be a strong word. Didn't really read the contract thoroughly.
12/03/2006 (4:12 pm)
Caylo you are way off by insulting John's customer support. You mentioned looking at your posts, you see his. He is just someone who has had to earn what he has through the same repeated beatings that you are currently going through. If you actually review some of the support the man has provided, it is outstanding in terms of going out of his way for others. However, expecting him to basically do all of the brain work on how to do you stuff is not reasonable. It is not his project that you are trying to modify his code for, he has no obligation to do anything for you in that regard. He is obligated, since we paid for it, to provide support for the product he sold with the way it was meant to perform. You can't expect him to have to walk you through the process of creating what you want, he offered you advice, and that is going beyond the scope of any obligations he had to you in terms of support for his product.
Hell obligated might even be a strong word. Didn't really read the contract thoroughly.
#16
And where do this "expecting him to basically do all of the brain work on how to do you stuff" come from? I have not shown that i am capable of doing the work myself? Have i not only simply asked for a bit more depth into the decal projector class? Have i not simple asked WHY the decal do not FOG as the rest of the rendering pipeline DO fog? I am simply puzzled that the decal projector gets to act so special, where is the consistency? If i can not expect one render object to behave as all the other render objects, i figured the oddly acting render object must be erroneous! perhaps busted? perhaps i busted it? perhaps it was something simple that i overlooked. All of the above was firring across my synapse, as i meekly ask a question and get a flipped non-answer for a reply.
What is insulting here is the fact i turned into the bad guy for bring into question what many others have already voiced. Im sure i am not the only person to feel slightly brushed off. At the same time i never expect spotlights to shine on me as i enter the forums to post my problems for the world to solve.
12/03/2006 (4:31 pm)
You know the funny thing is I alredy got my decal projecters to FOG, i added a handfull of more blending methods to them, and even hooked them up with animated textures. All of this done in a few hours with me knowing so very little about programing. (animated texture still bugging out on me...) And where do this "expecting him to basically do all of the brain work on how to do you stuff" come from? I have not shown that i am capable of doing the work myself? Have i not only simply asked for a bit more depth into the decal projector class? Have i not simple asked WHY the decal do not FOG as the rest of the rendering pipeline DO fog? I am simply puzzled that the decal projector gets to act so special, where is the consistency? If i can not expect one render object to behave as all the other render objects, i figured the oddly acting render object must be erroneous! perhaps busted? perhaps i busted it? perhaps it was something simple that i overlooked. All of the above was firring across my synapse, as i meekly ask a question and get a flipped non-answer for a reply.
What is insulting here is the fact i turned into the bad guy for bring into question what many others have already voiced. Im sure i am not the only person to feel slightly brushed off. At the same time i never expect spotlights to shine on me as i enter the forums to post my problems for the world to solve.
#17
12/03/2006 (4:50 pm)
Cool! Glad to hear you got it done. As for the spotlight, kind of an exagerration there, more like a LED key chain.
#18
John where do the projector actually get rendered out? its not in the logical place sgDecal::sgRender(DecalInstance *decal).... At this stage i would be happy to just switch the decal OFF when the player is 'x' distance away from it....
12/03/2006 (7:16 pm)
I was wrong, i still dont have the projector working nice with fog. What i thought was 'working' was bad testing on my side, with one of my new glBlendFunc types.John where do the projector actually get rendered out? its not in the logical place sgDecal::sgRender(DecalInstance *decal).... At this stage i would be happy to just switch the decal OFF when the player is 'x' distance away from it....
#19
12/03/2006 (9:00 pm)
All decals are rendered in DecalManager::renderDecal() which you will find in engine/sim/decalManager.cc at line 392.
#20
Its slowly starting to come together.
How is a relationship built between sgDecalManager and decalManager? Very possible im overlooking simple things, but cant comprehend how the projector is wedged into the decal rendering system.
And what is the reason for using the decal system to render a projector and not some part of shapebase? All this time i thought shapbase was the only way to get a renderable object, at least its understandable now why the projector do not do alot of the same things other render shapes do automatically.
12/03/2006 (11:33 pm)
Thanks, perfect. Its slowly starting to come together.
How is a relationship built between sgDecalManager and decalManager? Very possible im overlooking simple things, but cant comprehend how the projector is wedged into the decal rendering system.
And what is the reason for using the decal system to render a projector and not some part of shapebase? All this time i thought shapbase was the only way to get a renderable object, at least its understandable now why the projector do not do alot of the same things other render shapes do automatically.
Torque 3D Owner Scott Peal