Shader Problem

There are no stupid questions, just stupid answers.
  • 1
  • 2
15 posts Page 1 of 2
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Sat Apr 29, 2017 1:30 pm
Hello Friends,

i have a little Problem again :P

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;

shader = BumpCubemap;

};

new ShaderData( BumpCubemap )
{
DXVertexShaderFile = "shaders/custom/HLSL/Toksvig_NormalMaps.hlsl";
DXPixelShaderFile = "shaders/custom/HLSL/Toksvig_NormalMaps.hlsl";
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: 72
Joined: Fri Feb 27, 2015 5:13 pm
by irei1as » Sat Apr 29, 2017 5:14 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: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Sat Apr 29, 2017 11:37 pm
Hey,

thanks alot ... ill try ;)

greetz
Robert
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Sun Apr 30, 2017 12:38 am
Hello again,

i found something really cool:

https://www.beamng.com/threads/how-to-m ... ping.9709/

here a screenshot from my own:

Image

so i dont have to use custom hlsl shaders for this :)

gn8
Robert
Duion
Posts: 837
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Apr 30, 2017 9:35 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: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Sun Apr 30, 2017 12:16 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:

http://www.garagegames.com/community/fo ... read/96607

Sorry for asking :roll:

greetz
Robert
JeffR
Steering Committee
Steering Committee
Posts: 763
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Sun Apr 30, 2017 8:11 pm
Heh, no worries, can't get help if you don't ask any questions, after all ;)
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Mon May 01, 2017 9:03 am
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: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Mon May 01, 2017 12:20 pm
You must use the new macros created for use with Direct3D11 https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/shaders/common/shaderModel.hlsl .. check through any of the hlsl shaders in that directory for an example of how to use them.
subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Mon May 01, 2017 4:48 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 )  
{
shader = cubicReflection;
};


and then i go to shaders file (scripts/client/shaders.cs) - and add the following (for example):

singleton ShaderData( cubicReflection )  
{
DXVertexShaderFile = "shaders/common/basicCloudsV.hlsl";
DXPixelShaderFile = "shaders/common/basicCloudsP.hlsl";
pixVersion = 2.0;
};


i know i made something wrong - but where?

Thanks for your patience ;)

Greetings
Robert
  • 1
  • 2
15 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 1 guest