There are no stupid questions, just stupid answers.
• 1
• 2

subabrain
Posts: 190
Joined: Sat Aug 20, 2016 4:58 pm

Hello Friends,

i have a little Problem again

i have a custom shader and want it to be shown at a shape. So i tried the following (in art/shapes/cube/material.cs):
singleton Material(cube_GridMaterial)
{
mapTo = "GridMaterial";

diffuseMap[0] = "grid";
normalMap[0] = "";
specularMap[0] = "";

diffuseColor[0] = "1 1 1 1";
specular[0] = "0.9 0.9 0.9 1";
specularPower[0] = 0.415939;
pixelSpecular[0] = false;

};

{
pixVersion = 1.1;
};
But it doesnt work :/

EDIT: and with the standard shaders it also doesnt work...

Maybe you can help me for that - Thank you very much!

Nice Weekend and Greetings!
Robert

irei1as
Posts: 76
Joined: Fri Feb 27, 2015 5:13 pm
You need to use singleton CustomMaterial instead of Material. The shader thing is for CustomMaterial only.

I have my ShaderData as singleton. That may be also something you may want to change and I think it's better for that ShaderData to be defined before the CustomMaterial that uses it.

Now that I think about it, I don't recall default templates using any example CustomMaterial. Maybe one should be added as reference in one of the new modules.

subabrain
Posts: 190
Joined: Sat Aug 20, 2016 4:58 pm

Hey,

thanks alot ... ill try

greetz
Robert

subabrain
Posts: 190
Joined: Sat Aug 20, 2016 4:58 pm

Hello again,

i found something really cool:

here a screenshot from my own:

so i dont have to use custom hlsl shaders for this

gn8
Robert

Duion
Posts: 1050
Joined: Sun Feb 08, 2015 1:51 am

So you want to do parallax mapping? That works by default in Torque, though not very nicely and costs lots of performance.

subabrain
Posts: 190
Joined: Sat Aug 20, 2016 4:58 pm

Hello,

okay i see... but all shaders i tried where "fx" and not "hlsl" - which shaders i can use for t3d?

thanks a lot and nice day

EDIT: Sorry - i found this now:

greetz
Robert

JeffR
Steering Committee
Posts: 840
Joined: Tue Feb 03, 2015 9:49 pm

Heh, no worries, can't get help if you don't ask any questions, after all

subabrain
Posts: 190
Joined: Sat Aug 20, 2016 4:58 pm

Good Morning,

thanks for your post JeffR! But i still dont get it to work - is there any example hlsl?
i dont know why, but it still isnt working.

sorry for this question but i dont get it to run :/

greetings an nice sunday!
Robert

Timmy
Posts: 360
Joined: Thu Feb 05, 2015 3:20 am
You must use the new macros created for use with Direct3D11 https://github.com/GarageGames/Torque3D ... Model.hlsl .. check through any of the hlsl shaders in that directory for an example of how to use them.

subabrain
Posts: 190
Joined: Sat Aug 20, 2016 4:58 pm

Hello,

sorry im not getting it to work

but i will describe what ive done:

first i write the followig material into a cube material (art/shapes/cube/material.cs):
singleton CustomMaterial( cubicReflector )
{
};
singleton ShaderData( cubicReflection )
{
pixVersion = 2.0;
};
i know i made something wrong - but where?