Game Development Community

Hlsl-tgea docs request [Cont'd cleanly

by TheGasMan · in Torque Game Engine Advanced · 10/16/2007 (11:53 pm) · 3 replies

My other post was locked/closed so I had to start a new one.

1. I am requesting/looking for decent docs concerning the specifics of the hlsl implementation in TGEA. (NOT hlsl in general.) Ideally, I am looking for this information as so I can avoid the repetitive testing loop(to help me adapt at a faster pace). Nothing wrong with that, right ?

2. I am also curious about why shaders are not implemented on decals or particles. [ just asking for a reason if anyone knows one] plz, there is no reason to gripe...it IS an honest question.

*To add:
*I am willing to purchase "Decent" notes or documentation on the specifics of the hlsl implementation in TGEA.

// ==================
If you would like to see a more "in depth" posting on reasons...you can visit the starter thread which is now locked. here:
@ garagegames.com/mg/forums/result.thread.php?qt=68263
(This thread has loads of valid points that were left unrecognized.)

#1
10/17/2007 (12:33 am)
On 2: Decals never really got ported. That is why they are not linked in in most places a few bugs in their implementations. The implementation that is there thought is a nice base and you could add shaders if you need by using the mesh and the "relatively" simple possibility to add materials to it. (say relatively because there are enough other mesh classes that show how to use and there is as well a primbuilder - material thread here somewhere).

Particles are a different thing. Due to the nature of TGEA (pure shader, no fixed pipeline), making them use shaders (which they already do btw as they support alpha) would cause a fair amount of burnt GPU time no mather if you use a shader on a specific particle or not.

Similar to what happens if you want to get foliage reflected and refracted. The changed rendering order will drop your performance by 30-50% even if you don't have any foliage replicators in the mission.
#2
10/17/2007 (10:18 am)
1. I'm a bit confused about what you're asking with this question, but I'll try to answer it anyways.

a. Check out this article for information on CustomMaterials.

b. First you want to look at shdrConsts.h for the pixel and vertex shader constants that TGEA will setup for you for a CustomMaterial. If the meaning of a constant seems vague, then you want to go to the source, which would be CustomMaterial::setShaderConstants.

c. Beyond that, we just feed the hlsl straight to the DX SDK.

d. Another useful hint is to use ShaderData->reloadShader() at the console (replace shaderdata with the shaderdata object that your custommaterial refers too). This will reload the shader, allowing you to get a quicker edit->run->debug cycle.

2. I'm not sure. ;) I'm still new. It'd be pretty straightforward to add though, look at the fxFoilageReplicator as an example of something similar (I think the percipitation code also supports shaders, that maybe a better example).

Hope that helps.
#3
10/17/2007 (2:38 pm)
Thank you for the replies gentlemen.

Brian, Kudos and keep it real ;) .

- This is the type of information I was requesting. -> Something, AnYthing helpful and your post is a definite start.
I understand that the 1st question is a bit obscure...I did this for a reason: Because any insight on this will help myself and others who haven't ventured this path yet.

*For the help of all:*
...now we just need to extend this a bit more so that whatever this thread produces can grow to resource quality. ;) So...Perhaps we could extend this a bit further with someone else's post (anything helpful to add would be great).