Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Why won't my shader work on my fvf object?

Author
Message
Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 23rd Mar 2012 01:45 Edited at: 23rd Mar 2012 01:51
When I create an object through mem-blocks using fvf format my shader won't apply the texture, some of the shader works though.
like I can see the lighting sorta part of the shader but not the bump mapping and the texture itself is like not there.

I've tryed other shaders on the object and the texture on them would not show up as well

Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 23rd Mar 2012 01:56
where do you fill this array:
Quote: "triverts(o,i,num);"


Show as your shader

Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 23rd Mar 2012 03:05
What does "Show as your shader mean"?

I fill the struct like this..

Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 23rd Mar 2012 03:22
Quote: " /*obj[o].tri[i].u[tt]=dbMemblockFloat(1,mempos);//is the u coordinate of the texture mempos+=4; obj[o].tri[i].v[tt]=dbMemblockFloat(1,mempos);//is the v coordinate of the texture*/"

Why is this commented? In order for the texture to show up your object need to have uv coords

Quote: "What does "Show as your shader mean"?"

Post the shader code. Maybe it's the error in the shader. But i think it's the problem in non existing uv corrds because you commented those lines

Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 23rd Mar 2012 23:54
I set the uv'S elsewhere, I have shown you my shader. Plus I stated that I've tried official shaders on my object.
Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 24th Mar 2012 01:20
you only post a fractions of the code which may and may not have something to do with the problem you are experincing. How do you expect someone to help you?

Try to write this
Quote: " dbWriteMemblockDword(2,0*4,0x002 + 0x010 + 0x040 + 0x100 );// : `FVF format"

like this
dbWriteMemblockDword(2,0*4,0x002 | 0x010 | 0x040 | 0x100 );// : `FVF format

And compile your program and post it here with all the required media so i can try out and see the result

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2012 17:27
Quote: "dbWriteMemblockDword(2,0*4,0x002 + 0x010 + 0x040 + 0x100 );"


That could be your problem. The Diffuse component (0x040) causes problems with certain shaders in DBPro (especially those using tangents such as most bump mapping shaders) so I guess it's the same with DGDK. It may be possible to work around it. Depends on your object and shader though.

As Brendy Boy says, show us the whole of your shader.
Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 24th Mar 2012 19:02 Edited at: 25th Mar 2012 02:34
Thanks that's something I had no idea could Effect.



So how can I fix that. Any suggestions?

//NEVERMIND/
I got it.. thanks again. I commented out the lines for diffuse and changed the size from four to three times nine

dbWriteMemblockDword(2,0*4,0x002 + 0x010 + /*0x040 +*/ 0x100 );
dbWriteMemblockDword(2,1*4,9*3 );//`FVF size
dbWriteMemblockDword(2,2*4,29997);//number of vertices

how can I calculate memory size so I'm not using so much memory when I'm making my mem blocks

Login to post a reply

Server time is: 2024-04-20 15:27:51
Your offset time is: 2024-04-20 15:27:51