It is currently Thu Dec 14, 2017 12:02 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 9 posts ] 
Author Message
 Post subject:
PostPosted: Fri Feb 16, 2007 8:07 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
The material class is developed in VMK23A, and a visual explanation of the different parameters within the material class is shown.
VMK23B/C/D has been split into three parts so that the download file size is a little bit easier to work with. Because of this, VMK23B will only play up to the beginning of 15min. VMK23C contains the second part of the video and it will play from 15min up to the beginning of 30min. The rest of the video is stored in VMK23D and it will play from 30min to the end.  After you download all three parts, you can extract all VMK files (from 23B, 23C and 23D) into one directory to allow you to watch the entire VMK in one go.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 23 - Material Class
PostPosted: Fri Jun 17, 2011 7:45 pm 

Joined: Fri Sep 04, 2009 3:24 am
Posts: 30
What would cause the shadows not to show up on the materials?

They work fine when everything is grey, but when I add the material to the middle cube, it all shows up as bright red. I've played with the brightness (attenuation) and the rest of the scene will go bright or dark, but the red cube stays the same brightness. I've removed both the lights and the shadows still cast correctly on the other 2 cubes, but the one with the material is still unaffected.

Any ideals where I went wrong?

Thanks for any help.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 23 - Material Class
PostPosted: Sat Jun 18, 2011 7:35 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
Could you post some screen shots of what you are seeing, I'm not entirely sure what you mean.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 23 - Material Class
PostPosted: Mon Jun 27, 2011 6:22 pm 

Joined: Fri Sep 04, 2009 3:24 am
Posts: 30
Sorry it's takin' so long to get back with this. Everytime I tried, something would find a reason to get in my way :(

Anways, without a material, you see the second box, from the left, is slightly shaded.
Image

With the material there's no shading at all.
Image

The vmk shows the material slightly shaded, hence my problem. I've managed to shift the material to the other boxes as well, with the same results. I've removed the point light that points down and the headlight. I've added extra point lights in different positions and increased and decreased the brightness. All of which affected the shading on the boxes until the material was added.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 23 - Material Class
PostPosted: Mon Jun 27, 2011 11:58 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 450
Possible things to check. check and make sure your ColorGL classes are right, check your material classes are right, check your light classes are right, and even by chance your camera/player class(which should be good) and your scene class.

I don't remember if marek incorperated normals at this point in the vmks for the game engine, but if he did, you should check out your ObjectBox class. These are just areas to look at for any simple code errors. It could be anything from a + supposed to being a minus, a < or > check, or even calling the opengl functions in the wrong order. If you want to send me your source code, I could look at it. You can email it to me in a .rar file at anyone of these addresses.

skilz80@yahoo.com
skilz8099@gmail.com
skilz8099@homtail.com

first account is preferrable.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 23 - Material Class
PostPosted: Wed Jun 29, 2011 8:54 am 

Joined: Fri Sep 04, 2009 3:24 am
Posts: 30
Thanks, Marek said I had a typo in materal.cpp

In the code I had...
   m_f4Emmisive[0] = 0.0f;
   m_f4Emmisive[0] = 0.0f;
   m_f4Emmisive[0] = 0.0f;
   m_f4Emmisive[0] = 1.0f;


It should've been...
   m_f4Emmisive[0] = 0.0f;
   m_f4Emmisive[1] = 0.0f;
   m_f4Emmisive[2] = 0.0f;
   m_f4Emmisive[3] = 1.0f;


I had cut an pasted and forgotten to change the subscript. Although I knew I had a value off, it never once occurred to me that I was assigning different values to the same variable. The compiler didn't complain about em, so I developed tunnel vision and was only checking values.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 23 - Material Class
PostPosted: Wed Jun 29, 2011 9:37 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 450
That will do it! lol, but im glad you found the bug!


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 23 - Material Class
PostPosted: Sat Jun 01, 2013 7:44 pm 

Joined: Tue May 21, 2013 11:23 am
Posts: 5
I couldn't resist posting this. In the video I realized that the way you used FindNode in the Scene::Update allows the possibility of using a null pointer.
The following code was used:
Node * pNode;
pNode = m_vpNodes[0]->FindNode("Box2");
  if(pNode->isTransform() ) {
    ((NodeTransform*)pNode)->m_fRotateAngle += 0.5f;
           }

A safer way to go about this is, if (pNode && pNode->isTransform() )

The main reason I decided to post this is because I used to make the mistake of attempting to access null pointers in the past, and thought it would be worthwhile to mention incase anyone in the future has any problems with crashes.

Anyways, Marek thank you for these videos. They are quite helpful in my attempt to learn how to make 3D programs.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 23 - Material Class
PostPosted: Sun Jun 02, 2013 7:00 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
Good catch laso49! If you have suggestions for improvements for other vmk, please post them in the appropriate forum thread


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron